I have two functions:
function zoomChart() { chart.zoomToIndexes(0, 20000); } function zoomAtStartToLast90() { var dataLength = am_chartData.length; chart.zoomToIndexes(dataLength - 90, dataLength - 1); }
When I draw the chart at the beginning, I want to see the last 90 entries. So I need to call the zoomAtStartToLast90() function, but when I do an update on the chart, I want to see all 20k entries, so I will call zoomChart() .
inside AmCharts.ready(function () { I call it: chart.addListener("dataUpdated", zoomChart);
But where can I call the zoomAtStartToLast90() function? If I add it to addListener, the chart will be enlarged to 90 entries. Is it possible to call some function immediately after the table with the plugin?
source share