You must be logged in to post your query.
Home › Forums › Chart Support › Reset button
Tagged: Reset Button functionality
I want the reset functionality in a custom button click. document.getElementsByClassName(‘canvasjs-chart-toolbar’)[0].children[1].click()
The above solution works only for the first time . But, if you want to Zoom-in and reset it again it does not work.
@malvika,
You can reset the axis range programmatically by setting viewportMinimum & viewportMaximum to null. Please refer to the code-snippet below which shows how to reset the axis range on button click.
document.getElementById("resetChart").addEventListener("click", function() { chart.axisX[0].set("viewportMinimum", null, false); chart.axisX[0].set("viewportMaximum", null); });
Please take a look at this JSFiddle for complete code.
— Vishwas R Team CanvasJS
You must be logged in to reply to this topic. Login/Register