VIsualize.js Render
by Yuriy Bablyukh
HTML
<!--Provide URL to visualize.js-->
<script src="http://underscorejs.org/underscore.js"></script>
<script src="http://code.jquery.com/jquery-2.1.0.js"></script>
<script src="http://build-master.jaspersoft.com:6680/jrs-pro-feature-visualizejs/client/visualize.js?_opt=false"></script>
<!--Provide container to render your visualization-->
<div>
<div style="width:830px;" id="main"></div>
<div style="width:500px;" id="drill-down"></div>
</div>
CSS
#main{
float: left;
}
#drill-down{
float: left;
}
JavaScript
visualize({
auth: {
name: "superuser",
password: "superuser"
}
}, function (v) {
v("#main").report({
resource: "/public/Visualize/Hiperlinks/report32008A",
linkOptions: {
beforeRender: function (linkToElemPairs) {
linkToElemPairs.forEach(showCursor);
},
events: {
"click": function(el, link){
console.log(link);
if (link.type == "ReportExecution"){
v.report({
container: "#drill-down",
resource: link.parameters._report,
params: {
country:[link.parameters.country],
state:[link.parameters.state],
city:[link.parameters.city]
},
});
}
console.log(link);
}
}
},
error: function (err) {
alert(err.message);
}
});
function showCursor(pair){
var el = pair.element;
//el.style.cursor = "pointer";
}
});