fl_chart icon indicating copy to clipboard operation
fl_chart copied to clipboard

Fix a NAN crash for HTML web renderer

Open shalehaha opened this issue 2 years ago • 5 comments

cc @imaNNeoFighT

We are seeing a NAN crash when used it with HTML web renderer. I have tracked it down and found the line of code that is causing the problem. I'm not quite familiar with the code base, so I just made a quick fix for it which is easiest for me. There might be a more elegant way to fix it, in that case, you can just close my PR.

shalehaha avatar May 06 '22 18:05 shalehaha

Hi. Can you please send me a stack trace or something like that?

imaNNeo avatar May 12 '22 18:05 imaNNeo

Screen Shot 2022-04-22 at 12 34 49 PM

@imaNNeoFighT The stacktrace itself didn't show it's from the fl_chart lib, but I was able to trace down the problem to the lib.

shalehaha avatar May 12 '22 18:05 shalehaha

Is there a way to reproduce it?

imaNNeo avatar May 12 '22 20:05 imaNNeo

Codecov Report

Merging #992 (e12ff1d) into master (b0e3027) will increase coverage by 0.94%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #992      +/-   ##
==========================================
+ Coverage   85.17%   86.11%   +0.94%     
==========================================
  Files          42       42              
  Lines        2731     2701      -30     
==========================================
  Hits         2326     2326              
+ Misses        405      375      -30     
Impacted Files Coverage Δ
...ase/axis_chart/side_titles/side_titles_widget.dart 100.00% <100.00%> (ø)
lib/src/chart/bar_chart/bar_chart_renderer.dart 100.00% <0.00%> (+22.72%) :arrow_up:
...ib/src/chart/radar_chart/radar_chart_renderer.dart 100.00% <0.00%> (+22.72%) :arrow_up:
...rc/chart/scatter_chart/scatter_chart_renderer.dart 100.00% <0.00%> (+22.72%) :arrow_up:

:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

codecov[bot] avatar May 12 '22 21:05 codecov[bot]

I have the same issue for mobile browsers, when using SideTitles in a LineChart and all the data in the axis has the same value.

svki0001 avatar Jun 08 '22 11:06 svki0001

This issue has been fixed in 0.45.0. For more information, check here: https://github.com/imaNNeoFighT/fl_chart/blob/42e9863589072c33c0ae1bd9418da698c98eb075/lib/src/utils/utils.dart#L138-L140

imaNNeo avatar Jan 15 '23 12:01 imaNNeo