How to enable Highcharts scrollbar?

I tried to do

scrollbar: { enabled: true } 

But that did not work.

I tried using highcharts.js which comes with highstocks .. this didn't work either. Am I doing something wrong?

+7
source share
2 answers

If your code still does not work, you can try changing this:

 <script type="text/javascript" src="js/highcharts.js"></script> 

with this:

 <script type="text/javascript" src="https://code.highcharts.com/stock/highstock.js"></script> 

and you can add this:

 scrollbar: { enabled: true }, 

finally, you can add this to how many data points you want to view at a time, for example, "min: 6":

 xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], min: 6 <!-- LOOK at this --> }, 
+13
source

A similar question has already been answered here .

You can reference this: How to enable scrollbars in tall charts

 var chart = new Highcharts.Chart({ chart: { renderTo: 'container' }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], min: 6 }, legend: { verticalAlign: 'top', y: 100, align: 'right' }, scrollbar: { enabled: true }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }] }); 
+7
source

All Articles