Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 688ae5a

Browse files
authored
Merge pull request imaNNeo#395 from imaNNeoFighT/feature/bar-chart-top-titles
Feature/bar chart top titles
2 parents 67bca0d + 0089a18 commit 688ae5a

File tree

5 files changed

+744
-667
lines changed

5 files changed

+744
-667
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## {newVersion}
2+
* [Improvement] allowed to have topTitles in the [BarChart](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/bar_chart.md), see [BarChartSample5](https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/bar_chart.md#sample-5-source-code), #394.
3+
14
## 0.10.1
25
* [Improvement] Show barGroups `x` value instead of `index` in bottom titles, #342.
36
* [Improvement] [BREAKING] Use `double.infinity` instead of `double.nan` for letting `enterSpaceRadius` be as large as possible in the (PieChartData)[https://github.com/imaNNeoFighT/fl_chart/blob/master/repo_files/documentations/pie_chart.md#piechartdata], #377.

example/lib/bar_chart/samples/bar_chart_sample5.dart

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,32 @@ class BarChartSample5State extends State<BarChartSample5> {
3535
),
3636
titlesData: FlTitlesData(
3737
show: true,
38+
topTitles: SideTitles(
39+
showTitles: true,
40+
textStyle: const TextStyle(color: Colors.white, fontSize: 10),
41+
margin: 10,
42+
rotateAngle: 0,
43+
getTitles: (double value) {
44+
switch (value.toInt()) {
45+
case 0:
46+
return 'Mon';
47+
case 1:
48+
return 'Tue';
49+
case 2:
50+
return 'Wed';
51+
case 3:
52+
return 'Thu';
53+
case 4:
54+
return 'Fri';
55+
case 5:
56+
return 'Sat';
57+
case 6:
58+
return 'Sun';
59+
default:
60+
return '';
61+
}
62+
},
63+
),
3864
bottomTitles: SideTitles(
3965
showTitles: true,
4066
textStyle: const TextStyle(color: Colors.white, fontSize: 10),

0 commit comments

Comments
 (0)