#1356·recharts

downsample large data set / improving performances / LTTB algorithm

Author: beynarCreated Jun 25, 2018Updated Sep 10, 2026
Labelsfeature requestlarge dataset

Do you want to request a feature or report a bug?

request a feature

What is the current behavior?

LineChart (but maybe another Cartesian Component) is very laggy when displaying a large amount of Dots (8K in my case)

Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?

"recharts": "^1.0.0-beta.10"

Other people are concerned with this bug see- #1146 and #941 . But there is no solution for now. I personally use _.sampleSize but that's faaaar beyond a good solution since the shape displayed can be very different than the original one with all the dots.

A good solution seems to implement a largest-triangle-three-buckets algorithm (see the explanation here and some .js functions here and here

Disclaimer: I'm not clever enough to implement these case on m own (but i will try )

This algo is already implemented in some charts library such as D3fc or chartjs so it must be doable.

I think the better solution for recharts would be to implement a threshold props on the Line component (and other Cartesian Components) wich will modify the displayedData according to the LTTB algorithm.

The discussion is open, if you have any idea about downsampling large data for recharts : please share and participate.

Thanks for creating recharts btw,it's awesome des bisous