imaNNeo / imaNNeo/fl_chart

Missing events in touchCallback for pan and zoom

Open
#1,940 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

**Describe the bug**
As soon as a LineChart has a set transformationConfig property no FlPan* events are being reported anymore to touchCallback in lineTouchData.

**To Reproduce**
Modify LineChartSample12 so that lineTouchData includes a touchCallback:
```
lineTouchData: LineTouchData(
touchCallback:
(FlTouchEvent event, LineTouchResponse? touchResponse) {
debugPrint(event.runtimeType.toString());
},
...
```
Try to zoom and pan. This callback will not report FlPanStartEvent and subsequent events.

Is this intentional?

I need these events to figure out when the user has reached the starting point of the diagram to lazy load more data.

**Versions**
Flutter: 3.32.1
fl_chart: 1.0.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LineChartSample12 and its LineTouchData touchCallback reproduction. Trace how transformationConfig handles pan and zoom events, then compare the reported events with the expected FlPanStartEvent and subsequent events. Done means the callback reports the relevant pan events while zooming and panning, with behavior covered by an appropriate test if the project provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.