Skip to content

Commit

Permalink
Fix LineChart titles problem with single FlSpot, #1053
Browse files Browse the repository at this point in the history
  • Loading branch information
imaNNeo committed Jun 10, 2022
1 parent b0913d6 commit 7af85b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* **BUGFIX** (by @imaNNeoFighT): Fix tooltip issue on negative bar charts, #978.
* **IMPROVEMENT** (by @imaNNeoFighT): Use Container to draw axis-based charts border.
* **FEATURE** (by @FlorianArnould) Add the ability to select the RadarChart shape (circle or polygon), #1047.

* **BUGFIX** (by @imaNNeoFighT): Fix LineChart titles problem with single FlSpot, #1053.
*
## 0.51.0
* **FEATURE** (by @imaNNeoFighT): Add `SideTitleWidget` to help you use it in [SideTitles.getTitlesWidget]. It's a wrapper around your widget. It keeps your provided `child` widget close to the chart. It has `angle` and `space` properties to handle margin and rotation. There is a `axisSide` property that you should fill, it has provided to you in the MetaData object. Check the below sample:
```dart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,11 @@ class SideTitlesWidget extends StatelessWidget {
interval: interval,
);
axisPositions = axisValues.map((axisValue) {
var portion = (axisValue - axisMin) / (axisMax - axisMin);
final axisDiff = axisMax - axisMin;
var portion = 0.0;
if (axisDiff > 0) {
portion = (axisValue - axisMin) / axisDiff;
}
if (isVertical) {
portion = 1 - portion;
}
Expand Down

0 comments on commit 7af85b4

Please sign in to comment.