TitlesData disappears on LineChartData if minY is greater than maxY
- Dominant language
- Dart
- Stars
- 7.6k
- Forks
- 2k
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 2
Description
My LineChart is correctly drawn when using maxY greater than minY:
```
LineChart(
LineChartData(
minX: 1,
maxX: 18,
minY: 3,
maxY: -3,
borderData: FlBorderData(show: false),
lineTouchData: const LineTouchData(enabled: false),
titlesData: FlTitlesData(
show: true,
topTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
getTitlesWidget: (value, meta) {
return Center(
child: Text(
value.toInt().toString(),
style: const TextStyle(
fontSize: 8,
color: Colors.black,
),
textAlign: TextAlign.center,
),
);
},
),
),
bottomTitles: const AxisTitles(
sideTitles: SideTitles(showTitles: false),
),
leftTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
getTitlesWidget: (value, meta) {
final formattedValue =
(-3 - value).toInt().toStringAsFixed(2);
return Text(
formattedValue,
style: const TextStyle(
fontSize: 8,
color: Colors.black,
),
);
},
),
),
rightTitles: const AxisTitles(
sideTitles: SideTitles(showTitles: false),
),
),
lineBarsData: [
LineChartBarData(
color: Colors.green,
spots: [
const FlSpot(5, -2),
const FlSpot(6, -3),
const FlSpot(7, 0),
const FlSpot(8, 1),
const FlSpot(9, 2)
],
),
],
),
)
```

Flutter v3.24.2
fl_chart v0.69.0
Contributor guide
Research direction
Start by reproducing the provided LineChart and LineChartData example with minY greater than maxY, then trace how FlTitlesData renders axis titles. Done means TitlesData remains visible for this range while the chart continues to render correctly.
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
- 38/100