How to enable Highcharts scrollbar?

前端 未结 3 711
名媛妹妹
名媛妹妹 2020-12-18 00:55

I tried doing the

scrollbar: {
    enabled: true
}

But it didnt work.

I tried using the highcharts.js that comes with highstocks..

3条回答
  •  伪装坚强ぢ
    2020-12-18 01:47

    At the time of this answer, scrollbar can be added via highstock js. I managed to implement an elegant and simple scrollbar solution to my column chart, using only highcharts js, without highstock, as follows:

    chart: {
       type: 'column',
       scrollablePlotArea: {
       minWidth: {{ count($period_interval_categories) * 70}},
            // nr of interval data x (40 + 30) where 40 are column width pixels and
            // 30 is additional distancing between columns;
            // Increase spacing pixels if needed
       scrollPositionX: 1
       }
    },
    plotOptions: {
       column: {
           stacking: 'normal',
           pointWidth: 40, // column width in pixels
           dataLabels: {
               // enabled: true
           }
        }
    },
    

    where $period_interval_categories represents in my chart the period on x axis consisting of days, weeks, months, etc.

提交回复
热议问题