Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thorny LineChart #1625

Open
normidar opened this issue Apr 1, 2024 · 16 comments
Open

Thorny LineChart #1625

normidar opened this issue Apr 1, 2024 · 16 comments

Comments

@normidar
Copy link

normidar commented Apr 1, 2024

Don't make a duplicate issue.
Okey

Describe the bug
Line LineChart is thorny.

To Reproduce
To show sensors data on Line Chart.(33 fps & show 100 data in LineChart)

Screenshots

RPReplay_Final1711956844.mp4

Versions

  • which version of the Flutter are you using?
    • 3.19.4
  • which version of the FlChart are you using?
    • fl_chart: 0.67.0
@eloayoubi
Copy link

grafik
We got the same Issue since the Flutter 3.19.4 Update - fl_chart: 0.67.0

@ManuelRauber
Copy link

I can confirm this behavior as well. Same version as @eloayoubi running on an iOS device.

@e4ky
Copy link

e4ky commented Apr 16, 2024

try this: #1618 to disable linechart's default animation.

@eloayoubi
Copy link

eloayoubi commented Apr 16, 2024

try this: #1618 to disable linechart's default animation.

I have tried the suggestion to disable the animation for the Linechart with Duration.zero

It did not fix this issue.

As Workaround i have now set the LineChartBarData flag "isCurved" to true. It looks better than the current broken Chart. But it would be nice to have a fix for the thorny Line Problem.

@luisbelo91
Copy link

same issue since the Flutter 3.19.x update - fl_chart: 0.55.2 - only reproducible on iOS

@hngouveia01
Copy link

It seems to be related with Impeller renderer at Flutter version 3.19.x
Looks like it is fixed in Flutter version 3.22
As a workaround you could try to disable the Impeller engine by following this documentation:

https://docs.flutter.dev/perf/impeller#:~:text=Flutter%20enables%20Impeller%20by%20default,to%20the%20flutter%20run%20command.&text=To%20disable%20Impeller%20on%20iOS%20when%20deploying%20your%20app%2C%20add,your%20app%27s%20Info.plist%20file.

If it is not fixed, then it is not the Impeller.

This is the issue on Flutter repository:
flutter/flutter#146975

Although is about gradient being dithered, it applies to those awkward lines. My own experience ;)

@hngouveia01
Copy link

hngouveia01 commented May 17, 2024

Also, if after upgrading Flutter to 3.22 and the issue persists... Feel free to open an issue on the Flutter repo. :)
One more thing, this bug is not related to the fl_chart. If we update to the latest release of the package the problem remains.
It only happens on iOS because the Impeller engine is enabled by default on iOS operating system.
It is not enabled by default on Android.

@techouse
Copy link

techouse commented May 23, 2024

I still see this on Flutter v3.22.1 using Impeller with fl_chart v0.68.0. It's fine running on Skia.

image

@techouse
Copy link

techouse commented May 23, 2024

@normidar @eloayoubi @luisbelo91 @ManuelRauber @hngouveia01 should we / you / I make a bug report on flutter/flutter?

@hngouveia01
Copy link

@normidar @eloayoubi @luisbelo91 @ManuelRauber @hngouveia01 should we / you / I make a bug report on flutter/flutter?

Hi, @techouse. Don't get me wrong, I know you're a tech savvy :)
But there are two ways of disabling the Impeller. Have you tried both? Via .plist and command line?
I'm asking this because I found this comment here, and he got different results by disabling via .plist
#1410 (comment)

I'll get more info about this and report a bug about the Impeller. Thanks!

@hngouveia01
Copy link

@techouse, check this new PR merged in 3.23 and was present on 3.22 version:
flutter/flutter#146648

General fixes being merged:
https://github.com/flutter/engine/commits/main/impeller

@hngouveia01
Copy link

And it seems we have these two workarounds:

jonahwilliams
The reason this is happening is a bug with Path.close(). We should be ignoring the final close call which is supposed to draw a line to the path start - since this is stroke and not a fill.

So we should fix this, but in this case you don't need/shouldn't use the Path.close at the end there. Because the fix is going to be ignoring it anyway

@techouse
Copy link

techouse commented May 24, 2024

Hi, @techouse. Don't get me wrong, I know you're a tech savvy :) But there are two ways of disabling the Impeller. Have you tried both? Via .plist and command line? I'm asking this because I found this comment here, and he got different results by disabling via .plist #1410 (comment)

I got it disabled via the Property list.

<key>FLTEnableImpeller</key>
<false/>

The reason this is happening is a bug with Path.close(). We should be ignoring the final close call which is supposed to draw a line to the path start - since this is stroke and not a fill.

So we should fix this, but in this case you don't need/shouldn't use the Path.close at the end there. Because the fix is going to be ignoring it anyway

Ah, so I guess this calls for a PR to fl_chart until this is available in Flutter stable.

@hngouveia01
Copy link

Could be a solution! We are facing this problem too, so I'll give it a try this weekend and see what happens 😁

@techouse
Copy link

techouse commented May 25, 2024

@hngouveia01 So I did what flutter/flutter#146648 (comment) suggests and tried naively removing Path.close() in these places:

Unfortunately, I can see no changes. The line is still the same jagged line as in v0.68.0.

v0.68.0 (Flutter v3.22.1 + Skia) ✅ v0.68.0 (Flutter v3.22.1 + Impeller) ❌ v0.68.0 w/o Path.close() (Flutter v3.22.1 + Impeller) ❌
skia fl_chart_0 68 0 fl_chart_0 68 0_without_path_close

@techouse
Copy link

techouse commented May 25, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants