imaNNeo / imaNNeo/fl_chart

The bottomTitles duplicate when make liner Chart

Open
#1,758 3 comments 0 reactions 0 assignees View on GitHub
invalid Needs Reproducible Code
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

** Don't make a duplicate issue.
You can search in issues to make sure there isn't any already opened issue with your concern.

When i Make Liner Chart the bottomTitles duplicate like screenshot

LineChart(
LineChartData(
titlesData: FlTitlesData(
leftTitles: const AxisTitles(),
rightTitles: const AxisTitles(),
topTitles: const AxisTitles(),
bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
getTitlesWidget: (value, meta) {
switch (value.toInt()) {
case 0:
return const Text('Jan');
case 1:
return const Text('Feb');
case 2:
return const Text('Mar');
case 3:
return const Text('Apr');
case 4:
return const Text('May');
case 5:
return const Text('Jun');
case 6:
return const Text('Jul');
default:
return const SizedBox.shrink();
}
},
reservedSize: 20,
),
),
),
lineBarsData: [
LineChartBarData(
isCurved: true,
color: Colors.green,
barWidth: 5,
isStrokeCapRound: true,
belowBarData: BarAreaData(show: false),
dotData: const FlDotData(show: false),
spots: [
const FlSpot(0, 2),
const FlSpot(1, 1.5),
const FlSpot(2, 3),
const FlSpot(3, 2.8),
const FlSpot(4, 3.5),
const FlSpot(5, 2.3),
const FlSpot(6, 3),
],
),
LineChartBarData(
isCurved: true,
color: Colors.red,
barWidth: 5,
isStrokeCapRound: true,
belowBarData: BarAreaData(show: false),
dotData: const FlDotData(show: false),
spots: [
const FlSpot(0, 1),
const FlSpot(1, 2),
const FlSpot(2, 1.5),
const FlSpot(3, 3),
const FlSpot(4, 2.8),
const FlSpot(5, 3.5),
const FlSpot(6, 2.5),
],
),
],
borderData: FlBorderData(
show: false, // Remove the gray border
),
gridData: const FlGridData(drawHorizontalLine: false),
),
),
),
![Linear_chart](https://github.com/user-attachments/assets/d3e35139-79c7-42ee-8548-32013e29b664)

**Versions**
- Flutter Version : 3.22.3
- fl_chart: ^0.69.0

Contributor guide

Open the contributing guide

Research direction

Reproduce the provided LineChart example using FlTitlesData, AxisTitles, and SideTitles with fl_chart 0.69.0, checking whether the bottom title callback renders each month more than once. Trace the LineChart title-rendering entry point and compare the output with the attached screenshot; done means each configured bottom title appears once.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.