BarChart throws error when the y value of all bars is 0
- Dominant language
- Dart
- Stars
- 7.6k
- Forks
- 2k
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 2
Description
**Describe the bug**
Getting the below error when all the bars have 0 as there y-axis value in a BarChart-
!offset.dx.isNaN && !offset.dy.isNaN
"Offset argument contained a NaN value."
[error.log](https://github.com/imaNNeoFighT/fl_chart/files/9062883/error.log)
**To Reproduce**
To reproduce, pass all y values as 0 (empty graph)
**Versions**
- which version of the Flutter are you using? - 3.0.2
- which version of the FlChart are you using? - 0.51.0
Contributor guide
Research direction
Start by reproducing the BarChart with all y values set to 0 using Flutter 3.0.2 and fl_chart 0.51.0, then trace the BarChart rendering path associated with the reported NaN Offset error. Done means an all-zero dataset renders as an empty graph without throwing the assertion.
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
- 35/100