You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I thoroughly investigated a solution for supporting scale and panning of a line plot by manipulating minX and minY. I mostly followed the suggestions offered in this open issue.
After trying many of the offered solutions and a few of my own I reached the following conclusions:
supporting panning of a plot is best done using LineTouchData.touchCallback and handling FlPanUpdateEvent.
supporting zoom is very hard to do: using a GestureDetector / Listener only seems to work properly if my FlChart is warpped in an IgnorePointer widget. and unfortunately LineTouchData.touchCallback does not support scale events.
I forked fl_chart and tried to add a ScaleGestureRecognizer to RenderBaseChart and added a bunch of Fl***Events for scale events. I followed the usage pattern for the other gesture recognizers however this doesn't work.
Could you advice on how this should be added?
Here is the essence of what I tried to add in render_base_chart.dart:
Ok, Apparently the ScaleGestureRecognizer starts working if it replaces the PanGestureRecognizer entirely.
I think that we should add a flag to LineTouchData indicating if the user wishes to detect scale gesture. in this case we will use a ScaleGestureRecognizer instead of PanGestureRecognizer.
@imaNNeo could you please advise? what do you think?
yup ScaleGestureRecognizer and PanGestureRecognizer don't like to be put together. Solution for me was to check for the pointerCount: when only one, use details.focalPointDelta.dx to effectively get the panRecognizer.
With this, your #1721 restriction "enabling scale detection and pan gesture detection is not supported" is not longer, dito the need for switching between pan and scale.
I thoroughly investigated a solution for supporting scale and panning of a line plot by manipulating minX and minY. I mostly followed the suggestions offered in this open issue.
After trying many of the offered solutions and a few of my own I reached the following conclusions:
LineTouchData.touchCallback
and handlingFlPanUpdateEvent
.GestureDetector
/Listener
only seems to work properly if my FlChart is warpped in anIgnorePointer
widget. and unfortunatelyLineTouchData.touchCallback
does not support scale events.I forked fl_chart and tried to add a
ScaleGestureRecognizer
toRenderBaseChart
and added a bunch ofFl***Events
for scale events. I followed the usage pattern for the other gesture recognizers however this doesn't work.Could you advice on how this should be added?
Here is the essence of what I tried to add in
render_base_chart.dart
:and here:
The text was updated successfully, but these errors were encountered: