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

Issue with Trackball with CategoryAxis #52

Closed
jfox454 opened this issue Oct 31, 2019 · 2 comments
Closed

Issue with Trackball with CategoryAxis #52

jfox454 opened this issue Oct 31, 2019 · 2 comments

Comments

@jfox454
Copy link

jfox454 commented Oct 31, 2019

The following exception is thrown when using enabling a Trackball with a CategoryAxis x-axis.

════════ Exception caught by gesture library ═══════════════════════════════════
The following RangeError was thrown while dispatching a pointer event:
RangeError (index): Invalid value: Not in range 0..6, inclusive: 170

When the exception was thrown, this was the stack
#0 List.[] (dart:core-patch/growable_array.dart:147:60)
#1 _TrackballPainter._generateAllPoints
package:syncfusion_flutter_charts/…/user_interaction/trackball_painter.dart:631
#2 TrackballBehavior.show
package:syncfusion_flutter_charts/…/user_interaction/trackball.dart:206
#3 TrackballBehavior.onTouchDown
package:syncfusion_flutter_charts/…/user_interaction/trackball.dart:230
#4 _ContainerArea._bindInteractionWidgets.
package:syncfusion_flutter_charts/…/base/chart_base.dart:1636
...
Event: PointerDownEvent#19ffd(position: Offset(246.1, 405.0), timeStamp: 32:30:22.992000, pointer: 15, kind: touch, buttons: 1, down: true, pressure: 0.6, pressureMin: 0.0, pressureMax: 3.2, size: 0.1, radiusMajor: 91.8, radiusMinor: 91.8)
position: Offset(246.1, 405.0)
Target: RenderPointerListener#26a18 relayoutBoundary=up1
parentData: not positioned; offset=Offset(0.0, 0.0) (can use size)
constraints: BoxConstraints(0.0<=w<=391.4, 0.0<=h<=425.0)
size: Size(391.4, 425.0)
behavior: deferToChild
listeners: down, move, up
════════════════════════════════════════════════════════════════════════════════

This appears to be due to the following code in trackball_painter.dart (line 630):

} else if (axis is CategoryAxis) {
                        x = axis._visibleLabels[xValue.round()].text;
                      }

The _visibleLabel property of axis contains only 6 values due to the large number of x-values in my CategoryAxis, and these being truncated to display nicely.

I suspect this can be fixed by changing the code to:

} else if (axis is CategoryAxis) {
                        x = axis._labels[xValue.round()].text;
                      }
@dharanidharandharmasivam
Copy link
Contributor

Hi @jfox454 ,

Greetings from Syncfusion. We can replicate the reported scenario when displaying x-value with more number of points. We have already fixed this issue and it will be included in the upcoming Vol 3 SP1 update which is expected to be rolled out in the first week of November 2019. We will intimate you once the release is rolled out. We appreciate your patience until then.

Thanks,
Dharani.

@dharanidharandharmasivam
Copy link
Contributor

Hi @jfox454 ,

Thanks for being patience. The reported issue has been fixed, now the exception will not be thrown when displaying x-value with more number of points in trackball. To resolve the reported issue, kindly upgrade your packages from the below link.

https://pub.dev/packages/syncfusion_flutter_charts

Thanks,
Dharani.

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

3 participants