You are not logged in.
I love the export functionality exposed using SAIKU_CHART_HTML. But I'd like to be able to customize the result further and wonder if it's possible to get access to the resources underlying the full HTML page that you get using /httpauthexport?format=SAIKU_CHART_HTML.
Looking at the source for an export I see:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="../resources/saiku/js/jquery/jquery.min.js"></script>
... and a bunch of other imports
</head>
<body>
<script type="text/javascript" src="../resources/saiku/js/saiku/plugins/CCC_Chart/plugin.js"></script>
<script>
$(function(){
var data = {"cellset":[[{"value":"Date","type":"ROW_HEADER_HEADER","properties":{"hierarchy":"[Date]","dimension":"Date","level":"[Date].[Date]"}},
...;
// code to render the chart using the data var
});
</script>
<div class="workspace">
...
</div>
</body>
</html>
Is there maybe a way to access the JSON that populates the data variable above for instance? That would allow me to write a page that defines a chart area etc into which I could pull arbitrary data and also add some additional styling.
Or maybe there's some different way to embed a dynamic list chart? Note that for this it's of great interest to me to be able to use /httpauthexport so the charts may be publicly available.
Cheers,
/GvH
Offline
Hi,
look for the file charttemplate.html in war/resources/saiku/charttemplate.html. This file is used as the template for all chart exports.
Cheers,
Thorsten
Ah, right. So after looking at the template my question becomes: is there any way to expose the data I presume is rendered server-side to replace /*##DATA##*/ so I can get at it as a JSON object via a URL?
Cheers,
/GvH
Last edited by zzgvh (2015-03-02 14:49:35)
Offline
There is no built in function to just get the json part, but you could write a custom output generator that does this. The script guide contains more information on registering a custom output generator. For you implementation you can basically copy the SaikuChartHTMLOutputGenerator and just strip away the part that integrates the json-string with the template.
Cheers,
Thorsten
Allright, time to get serious with scripting!
As always, thanks for your great guidance,
/GvH
Offline