0

I am using highcharts to generate chart based on selecting items in a dropdown list. When I select first item from the dropdown it is showing correct data. When I select second item from the dropdown it is also showing correct data. But when I select first item from the dropdown again then it is appending few data with the first chart.

For example: first dropdown item has 1000 data points. Second dropdown item has 1500 data points. When I select first item of the dropdown after selecting second item of the dropdown then the first 1000 data points are correct but it also append 500 abnormal data in the chart. Because the second item hase 1500 data points in total. The first item always get teh size of the second item when I select second item.

How can I fix that?

4

1 回答 1

0

执行图表后,我们需要清空数组。这将解决问题。

如果我们将chartData作为数组传递给highcharts,那么在highchart的末尾我们可以使用chartData.length = 0。这将使数组为空,当我们从下拉列表中选择一个新项目时,它将获得新的大小选定的项目。

谢谢

于 2013-09-16T11:53:33.480 回答