Visualize: search in report and zoom in/out
Visualize: search in report and scale
by Pavel Savushchyk
February 23, 2016
HTML
<script src='http://localhost:8080/bugfix/client/visualize.js?_opt=false'></script>
<!--Provide container to render your visualization-->
<button id="chart1">Change type to 1 chart
</button>
<button id="chart2">Change type to 2 chart
</button>
<button id="chart3">Change type to 3 chart
</button>
<div id="container"></div>
CSS
.jr_search_result {
background-color: green;
}
JavaScript
visualize({
auth: {
name: "superuser",
password: "superuser"
}
}, function (v) {
var report = v.report({
resource: "/public/Samples/Reports/9.CustomerDetailReport",
error: handleError,
success:function(data){
console.log(data);
},
container: "#container"
});
//show error
function handleError(err) {
alert(err.message);
}
$("#chart1").click(function (){
report.updateComponent("46b1487d-1530-4bb7-9608-e0ae86f7cb7c", {
chartType: "Bar"
}).done(function (data) {
console.log(data);
}).fail(handleError);
});
$("#chart2").click(function (){
report.updateComponent("05e92a34-606f-496c-a376-6e24d26fdf50", {
chartType: "Area"
}).done(function (data) {
console.log(data);
}).fail(handleError);
});
$("#chart3").click(function (){
report.updateComponent("f52c851a-32b4-4639-b1a6-6aebba49e524", {
chartType: "Line"
}).done(function (data) {
console.log(data);
}).fail(handleError);
});
});