Home › Forums › Chart Support › Button to zoom › Reply To: Button to zoom
You can programmatically zoom into certain region by setting viewportMinimum and viewportMaximum. If you like to set zoom into certain region after clicking the button, you can do so by changing viewportMinimum & viewportMaximum on clicking the button. Below is the code-snippet for the same.
chart.axisX.set("viewportMinimum", new Date(2002, 01, 01), false);
chart.axisX.set("viewportMaximum", new Date(2006, 01, 01));
Please take a look at this JSFiddle for complete code.
Also take a look at this jsfiddle, where viewportMinimum and viewportMaximum are changed based on dropdown options.