imaNNeo / imaNNeo/fl_chart

[Linear Chart] [Tiles] The x axis is being autocompleted

Open
#1,576 1 comment 1 reaction 0 assignees View on GitHub
Line Chart Needs Reproducible Code
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

I have the following FlSpot list:

FlSpot(1, 0),
FlSpot(30, 0),
FlSpot(29, 0),
FlSpot(28, 0),
FlSpot(27, 0),

Because there is FlSpot(1, 0), it autocompletes the x axis until it reaches FlSpot(27, 0), thus, an undesirable behavior

Code:

lineBarsData: [
LineChartBarData(
barWidth: 5,
color: Color(0xFFE8A0BF),
spots: [
FlSpot(1, 0),
FlSpot(30, 0),
FlSpot(29, 0),
FlSpot(28, 0),
FlSpot(27, 0),
],
dotData: FlDotData(show: true),
),
]

expected: 1 , 30, 29, 28, 27
obtained: 1, 2 , 3 , 4, 5, 6, 7, 8, 9, 10, 11, 12.....25, 26 ,27, 28, 29, 30

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the provided FlSpot list in a LineChart using LineChartBarData and inspect how the x-axis handles the non-sequential values. Verify the fix by confirming the rendered axis preserves 1, 30, 29, 28, and 27 rather than filling the range with intermediate values.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
data-visualization
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.