Change default zoom highcharts
Change default zoom highcharts

Change default zoom highcharts

If you are using Highcharts and want to change default zoom value then change rangeSelector value and by default its set to 1 means it will show you 3 month chart data. Below code will show All data:

// Create the chart
	        $('#container').highcharts('StockChart', {

	            rangeSelector : {
	                selected : 8
	            },

	            title : {
	                text : ric+' Details data'
	            },
	            

	            series : [{
	                name : ric,
	                data : data,
	                tooltip: {
	                    valueDecimals: 2
	                }
	            }]
	        });

Change default zoom highcharts

As you see rangeSelector: selected : 8 will show all data.

  • selected : 1 –> 3 Months
  • selected : 2 –> 6 Months
  • selected : 4 –> 1 Year
  • selected : 8 -> All

 

Leave a Reply

Your email address will not be published. Required fields are marked *