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

DateTime LineSeries - Gesture Callback Issues #30

Closed
walsha2 opened this issue Sep 20, 2019 · 2 comments
Closed

DateTime LineSeries - Gesture Callback Issues #30

walsha2 opened this issue Sep 20, 2019 · 2 comments

Comments

@walsha2
Copy link

walsha2 commented Sep 20, 2019

Description:

I am seeing some issues with using gesture detection methods with latest version (have always had this issue, even with previous versions) - The sample data is provided below as screenshot and code to reproduce at the end of this issue.

Description: Issue 1

First issue I am seeing is with trackball gesture detector. To recreate this issue do the following:

  1. Use one finger to tap and display the trackball
  2. Keep holding tap
  3. Now with a second figure tap or drag somewhere else on the chart area

This sometimes happens when you are attempting to pinch zoom and both fingers don't touch at the same time. You will get the following trace in debug console (it does not crash the app):

════════ Exception caught by gesture ═══════════════════════════════════════════
The following NoSuchMethodError was thrown while handling a gesture:
The getter 'dx' was called on null.
Receiver: null
Tried calling: dx

Caused by chart_base,dart in the following location:

if (chart.trackballBehavior.activationMode ==
    ActivationMode.singleTap) {
  chart.trackballBehavior.onTouchMove(position.dx, position.dy);

Description: Issue 2

This issue is a little more catastrophic. It will result in this to be rendered in chart area (when in debug mode):

This is trickier to recreate but you can do it by using two fingers, tapping and holding on chart area.


Likely an issue with intervalType and how it is handled in code.

primaryXAxis: DateTimeAxis(
	isVisible: true,
	intervalType: DateTimeIntervalType.days,
	dateFormat: DateFormat('M/dd/yy'),
	placeLabelsNearAxisLine: false,
),

I believe this has to do with DateTime axis and the fact that there are some missing protections in datetime_axis.dart in the _alignRangeStart - I believe this is where the error is stemming from.

  /// Returns the range start values based on actual interval type
  int _alignRangeStart(DateTimeAxis axis, int startDate, num interval) {
    DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(startDate);
    switch (axis._actualIntervalType) {
...
  }

Code To Reproduce:

Please run this simple main.dart to reproduce. All the code lives within it, attached below as txt file:

main.txt

@dharanidharandharmasivam
Copy link
Contributor

Hi @walsha2 ,

We regret for the inconvenience. We can replicate the issue at our end, and we will include the fix for the reported issue in our upcoming update. We will let you know once we have published and we appreciate your patience until then.

Thanks,
Dharani.

@dharanidharandharmasivam
Copy link
Contributor

Hi @walsha2 ,

Thanks for being patience and the reported issues have been fixed. Now the trackball and the date-time axis will be rendered without any exception. To resolve the reported issues, 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