docs/wiki/05-performance-and-large-datasets.md
LineChart supports built-in downsampling through chartPerformance(_:).
public enum ChartPerformanceMode {
case none
case automatic(threshold: Int, maxPoints: Int, simplifyLineStyle: Bool)
case downsample(maxPoints: Int, simplifyLineStyle: Bool)
}
LineChart()
.chartData(largeSeries) // e.g. 2000+ points
.chartPerformance(.automatic(
threshold: 600,
maxPoints: 180,
simplifyLineStyle: true
))
When simplifyLineStyle is enabled:
This reduces render overhead for dense data.
For chartData([Double]), downsampled values are remapped to categorical slot indices to keep axis alignment stable.
threshold and maxPoints for your dataset size and UI refresh rate.