imaNNeo / imaNNeo/fl_chart

How to display the exact x value provided to FlSpot in SideTitles?

Open
#1,096 8 comments 0 reactions 0 assignees View on GitHub
Lack of Information
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

I need to display the exact x values that I've provided to `spots`, but when I get the value in `getTitlesWidget` it is different from the original data. Actually, I don't want the `interval` changes the value. Is it possible with fl_chart?
By the way, thanks for the awesome package!
```
...
bottomTitles: AxisTitles(
sideTitles: SideTitles(
showTitles: true,
reservedSize: 20,
interval: 600,
getTitlesWidget: (value, meta) {
final dateFormat = intl.DateFormat("H");
return Text(
dateFormat.format(
ViewHelper()
.convertTimeStampToDate(value.toInt()),
),
);
},
),
),
...
```

Contributor guide

Open the contributing guide

Research direction

Start with the SideTitles and getTitlesWidget behavior shown in the issue, reproducing it with interval set to 600 and the supplied spots. Trace how the callback value is generated and determine whether exact x values can be displayed without interval altering them. Done means the requested values are preserved and the behavior is covered by an appropriate chart test.

Written by the indexing model from the issue text.

Assessment

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