Skip to content

Commit

Permalink
Add migration guide
Browse files Browse the repository at this point in the history
  • Loading branch information
xvrh committed Mar 28, 2024
1 parent eb9ce49 commit 526c16a
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Migrate to new version

## Replaced tooltipBgColor

**Breaking: [#1595](https://github.com/imaNNeo/fl_chart/pull/1595)**

We added the ability to customize the tooltip background color for each point.

The property `Color tooltipBgColor` from Bar, Line and Scatter Charts is replaced with a callback `Color Function(spot) getTooltipColor`

#### BarChartData

Previously:
```dart
BarChartData(
barTouchData: BarTouchData(
touchTooltipData: BarTouchTooltipData(
tooltipBgColor: Colors.blueGrey,
)
)
)
```

Now in new version:

```dart
BarChartData(
barTouchData: BarTouchData(
touchTooltipData: BarTouchTooltipData(
getTooltipColor: (BarChartGroupData group) => Colors.blueGrey,
)
)
)
```

#### LineChartData

Previously:
```dart
LineChartData(
lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.blueGrey,
)
)
)
```

Now in new version:

```dart
LineChartData(
lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData(
getTooltipColor: (LineBarSpot touchedSpot) => Colors.blueGrey,
)
)
)
```

#### ScatterChartData

Previously:
```dart
ScatterChartData(
scatterTouchData: ScatterTouchData(
touchTooltipData: ScatterTouchTooltipData(
tooltipBgColor: Colors.blueGrey,
)
)
)
```

Now in new version:

```dart
ScatterChartData(
scatterTouchData: ScatterTouchData(
touchTooltipData: ScatterTouchTooltipData(
getTooltipColor: (ScatterSpot touchedBarSpot) => Colors.blueGrey,
)
)
)
```

4 changes: 3 additions & 1 deletion repo_files/documentations/migration_guides/INDEX.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ Here are fl_chart's migration guides:

#### [Migrate to 0.50.0](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/migration_guides/0.50.0/MIGRATION_00_50_00.md)

#### [Migrate to 0.55.0](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/migration_guides/0.55.0/MIGRATION_00_55_00.md)
#### [Migrate to 0.55.0](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/migration_guides/0.55.0/MIGRATION_00_55_00.md)

#### [Migrate to 0.67.0](https://github.com/imaNNeo/fl_chart/blob/main/repo_files/documentations/migration_guides/0.67.0/MIGRATION_00_67_00.md)

0 comments on commit 526c16a

Please sign in to comment.