简体   繁体   中英

Limit data points with chart js in React

I've setup a line chart with chart js.

在此处输入图像描述

As you can see I have too many points with data. Is there any way to limit points in chart itself or maybe to cut the data? The current form of this graph is hard to read and bad for the performance.

To improve the over-labeling, set a limit on the number of ticks. Limit labels number on Chart.js line chart . To improve the load speed, you would want to display less data points, so trimming the data before displaying it could be an option.

You can make use of the build in data decimation that limits the amount of data points.

Example: https://www.chartjs.org/docs/master/samples/advanced/data-decimation.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM