Highcharts chart going blank on zoomType: 'x' area range zoom?

前端 未结 1 931
无人共我
无人共我 2021-01-13 19:37

Ok, so I have a Highcharts chart displaying data correctly from a database; but the moment I zoom in, the chart goes blank?

Here is the chart HTML:

&         


        
相关标签:
1条回答
  • 2021-01-13 20:15

    I worked out what the issue was after hunting through the Highcharts API documentation.

    There is a property of all chart types that I'm aware of called 'cropThreshold', here is the link to the Highcharts API explaining what this is in detail: http://api.highcharts.com/highcharts#plotOptions.area.cropThreshold

    But in summary; if you display more than 300 points (cropThreshold defaults to 300), then when zooming in, your chart will go blank. To correct this, you can add the following to your chart configuration:

    area: {
               cropThreshold: 500 <- //Vary this. I display 500 points on my chart in
                                     //total and so a value of 500 allows zooming to
                                     //work at all levels. This will vary for you
                                     //depending on how many points you plot.
          }
    
    0 讨论(0)
提交回复
热议问题