Improve highcharts performance for large amounts of data

前端 未结 7 1171
名媛妹妹
名媛妹妹 2021-02-02 01:38

I am trying to get a larger amount of data. Sample data is below

1850/01   -0.845   -0.922   -0.748   -1.038   -0.652   -1.379   -0.311   -1.053   -0.636   -1.41         


        
7条回答
  •  不知归路
    2021-02-02 01:56

    You don't show what is your choice for the xAxis, but if massaging the data in the server side is not an option what I would suggest is:

    1. First do a call to load the data.
    2. Show at spinning wheel where the chart is going to be displayed
    3. Start parsing the dataset but don't load it all at once but in batches and redraw the chart as you parse the rest of the file.

    This should avoid the freezing and give the visual indication that the data is being loaded.

    Edit: Response to comment I don't think is any longer an issue loading the data but on how to display the data in a meaningful way. Even if it loads in 2 seconds the result would be thousands of lines overlapping and totally unreadable.

    You should default few hand picked values (ex Current month and same month and 1, 5, 10 years ago) and then allow the user to change the selection select up to a reasonable number of years/month (ex Compare July for 1980, 2010 and 2017) then plot those values updating the chart with (chart.series[0].update(....). There were no columns in the dataset so I assumed it was a column per month but I see now that they seem to be one per row and 11 columns represent some other data.

    I don't think for a polar chart doing averages or doing rollups of the data is the best way to go but allowing to compare specific years and month with the exact data, whatever those values are :)

提交回复
热议问题