【发布时间】:2020-08-18 15:00:10
【问题描述】:
在 React Redux 应用程序中,我有一个包含时间序列数据(大约 10k 数据点)的大型数组。数据由 redux 存储提供。该应用程序使用highcharts-react-official 2.x.x。大数组经常通过追加新数据点来更新(仅追加,现有数组元素是不可变的)。
由于这些更新,图表似乎每次都完全呈现。我怎样才能避免这种情况?
const options = {
series: [
{
type: 'line',
data: objectFromReduxStore.map(p => ([p.time.toMillis(), p.value])),
}
]
}
...
<HighchartsReact
highcharts={Highcharts}
options={options}
containerProps={{style: {height: '300px', width: '100%'}}}
/>
【问题讨论】:
标签: reactjs redux highcharts react-highcharts