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

Animated Chart Type Error when using duration over 30 milliseconds #96

Open
floodoo opened this issue Sep 20, 2023 · 3 comments
Open

Animated Chart Type Error when using duration over 30 milliseconds #96

floodoo opened this issue Sep 20, 2023 · 3 comments
Assignees
Labels
bug Something isn't working waiting for response Wait for client response

Comments

@floodoo
Copy link

floodoo commented Sep 20, 2023

Description:

I encountered an issue with the Animated Chart in your charts_painter library. Specifically, when I set the animation duration over 30 milliseconds, I receive the following error:

Exception: type 'ChartItem<void>' is not a subtype of type 'ChartItem<MyCustomModel?>' of 'startValue'
or
Exception: type 'ChartItem<void>' is not a subtype of type 'ChartItem<MyCustomModel?>' of 'endValue'

Stacktrace

String: type 'ChartItem<void>' is not a subtype of type 'ChartItem<MyCustomModel?>' of 'endValue'
#0      ChartItem.animateTo (package:charts_painter/chart/model/geometry/chart_item.dart:21:41)
#1      ChartItemsLerp._lerpItemList.<anonymous closure> (package:charts_painter/chart/model/data/chart_data.dart:237:25)
#2      new _GrowableList.generate (dart:core-patch/growable_array.dart:136:28)
#3      ChartItemsLerp._lerpItemList (package:charts_painter/chart/model/data/chart_data.dart:193:12)
#4      ChartItemsLerp.lerpValues.<anonymous closure> (package:charts_painter/chart/model/data/chart_data.dart:181:14)
#5      new _GrowableList.generate (dart:core-patch/growable_array.dart:136:28)
#6      ChartItemsLerp.lerpValues (package:charts_painter/chart/model/data/chart_data.dart:180:12)
#7      ChartData.lerp (package:charts_painter/chart/mode<…>

However, the error doesn't occur when using the non-animated Chart or when the animation duration is set to or under 30 milliseconds.

Steps to Reproduce:

  1. Use the Animated Chart
  2. Set the animation duration to 300 milliseconds.
  3. Observe the error.

Expected Behavior:

The chart should animate without errors.

Actual Behavior:

An error is thrown when the animation duration is 300 milliseconds.

Workaround:

Use the Chart without animation.
Set the animation duration to 30 milliseconds.

Environment:

Flutter version: 3.13.2
charts_painter version: 3.1.1
OS: macOS with an iOS Simulator iPhone 14 Pro Max

@lukaknezic lukaknezic self-assigned this Sep 21, 2023
@lukaknezic lukaknezic added the bug Something isn't working label Sep 21, 2023
@lukaknezic
Copy link
Contributor

@floodoo Can you provide a code snippet where you get this issue?
I tried with charts from example but couldn't reproduce this issue

@lukaknezic lukaknezic added the waiting for response Wait for client response label Oct 13, 2023
@floodoo
Copy link
Author

floodoo commented Oct 17, 2023

No sry, I can't provide any code due to company confidentiality.

@lukaknezic
Copy link
Contributor

Hi @floodoo. Sorry for late reply but can you maybe make a snippet that won't actually use any confidential data? I just need minimal reproducable code where this happens.
I tried saving custom model to charts items and having animations over and under 30 ms but I could not reproduce this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting for response Wait for client response
Projects
None yet
Development

No branches or pull requests

2 participants