I created a graph using the ZingChart library and everything works as expected. The graph is used to display the power consumption of a specific output over time.
When the graph loads, the system displays the kWh consumption for this period of time.
The user was able to increase and decrease the graph, and when this happens, I would like to show the energy consumption for this period of time shown on the graph.
I am 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 getseriesdata, getseriesvalues โโand getplotvalues โโfunctions always return full graph values, not just visible ones.
The p object gives me new x and y limits, but I cannot find a way to use them to get only visible values.
Has anyone done this?
Any help is greatly appreciated.
Thanks!
source share