I created a Graph using ZingChart library and everything is working as expected. The graph is used to show the power consumption of a specific outlet over time.
When the graph is loaded the system shows the kWh consumption for that time period.
The user was the ability to zoom in and out the graph, and when that happens I would like to show the power consumption for that period of time shown in the graph.
I'm using the zoom event:
zingchart.render({
id:'chartDiv',
data:graphset,
height:500,
events:{
zoom:function(p){
console.log(p);
console.log(zingchart.exec(p.id, 'getseriesdata', {}));
console.log(zingchart.exec(p.id, 'getseriesvalues', {}));
console.log(zingchart.exec(p.id, "getplotvalues", {}));
}
},
width:"100%"
});
When I zoom in or out, the functions getseriesdata, getseriesvalues and getplotvalues always return the full graph values, not just the visible ones.
The p object gives me the new x and y limits, but I can't find a way to use them to get only the visible values.
Has anyone done this?
Any help is very much appreciated.
Thanks!