imaNNeo / imaNNeo/fl_chart

FlTitlesData -> leftTitles shows static highest value with overlap on other titles

Open
#906 30 comments 22 reactions 0 assignees View on GitHub
Bar Chart enhancement
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

**Describe the bug**
A picture says more than 1000-words
![image](https://user-images.githubusercontent.com/535446/153958248-0768c833-fd37-43b4-ae72-b6a771f5e287.png)
Titles are correct most of the time, like in the picture below
![image](https://user-images.githubusercontent.com/535446/153958319-79e30d36-2a73-4c89-8609-e9925036ff03.png)

This static value was not showing in fl_chart v0.40.2 that I used before.

**To Reproduce**
```dart
//Textstyle
TextStyle? verticalSideTitle = Theme.of(context)
.textTheme
.bodyText2
?.copyWith(
fontSize: 10, color: currentTheme.verticalSideTitle);

//Barchart Init
BarChart(BarChartData(
//...
titlesData: FlTitlesData(
show: true,
leftTitles: SideTitles(
showTitles: true,
reservedSize: _reservedVertical,
getTextStyles: (context, value) => verticalSideTitle,
margin: 0,
),
topTitles: SideTitles(showTitles: false),
rightTitles: SideTitles(showTitles: false),
),
//...
));
```

**Versions**
Flutter v2.10.1
fl_chart: 0.45.0

Contributor guide

Open the contributing guide

Research direction

Start with the BarChart and FlTitlesData reproduction shown in the issue, using Flutter 2.10.1 and fl_chart 0.45.0, then compare the title behavior with fl_chart 0.40.2. Trace how leftTitles values are laid out and verify that the static highest value no longer overlaps other titles; add or update a focused regression test if the project has one for this behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.