Search code examples
javascriptamchartsamstock

How to change zoom level of amStockChart programmatically?


I want to change the zoom level of my amStockChart from 1H to 1W through javascript code (without clicking the period selector buttons). I am using amcharts 3 and am not able to find a way to do this. My chart is a normal one like any of the example from amCharts website. Also I am not pasting my chart config here as it will not add any value to the question as this is not config dependent.


Solution

  • May be you can try this:

    yourChartObject.periodSelector.periods[yourDesiredZoomLevel].button.click();