This page summarizes migration to 2.0.0.
- Legacy chart view types are replaced by composable chart primitives.
- Legacy mutating method chains are replaced by modifier APIs.
- Interaction no longer requires
@EnvironmentObject.
| 1.x | 2.x |
|---|---|
LineChartView |
LineChart |
BarChartView |
BarChart |
PieChartView |
PieChart |
MultiLineChartView |
multiple LineChart layers |
| 1.x | 2.x |
|---|---|
.data(...) |
.chartData(...) |
.rangeX(...) |
.chartXRange(...) |
.rangeY(...) |
.chartYRange(...) |
.setAxisXLabels(...) |
.chartXAxisLabels(...) |
.setNumberOfHorizontalLines(...) |
.chartGridLines(...) |
.showChartMarks(...) |
.chartLineMarks(...) |
Pick one:
- shared state:
.chartInteractionValue(ChartValue())
- callback style:
.chartSelectionHandler { event in ... }
See MIGRATION.md for complete type + method mapping.