Highcharts strange grouping behaviour

后端 未结 1 658
时光说笑
时光说笑 2021-01-26 03:11

I am using the lazy loading method to load OHLC data. On the server side I use Python + MySQL and have 4 tables with OHLC data and time intervals of 5min, 1hour, 1day, 1month. A

1条回答
  •  后悔当初
    2021-01-26 03:43

    Here is the solution:

    1. No grouping on chart init

    To solve the grouping problem at the initialization stage, use the following lines:

    Highcharts.stockChart('container', {
        //.... your code ...
    }, function(chart){
        chart.rangeSelector.clickButton(1);
        });
    

    The problem here was that the selected button from chart options was not triggering afterSetExtremes event for xAxis.

    1. No grouping when clicking the rangeSelector

    To avoid Highcharts grouping the data when clicking between the rangeSelector buttons, set the chart as follows:

    rangeSelector: {
        buttons: [{
            dataGrouping: {
                forced: false }
                 }] }
    

    0 讨论(0)
提交回复
热议问题