Hey, I would like to override the onTouchDown, onTouchMove, etc... methods of the CrosshairBehaviorRenderer class, but how would I go about doing that since I only supply a CrosshairBehavior to the SfCartesianChart.
Thank you in advance!
I wish to override the methods of the CrosshairBehaviorRenderer such that I can make it so the crosshair can be moved along a single axis at a time (so when touching the vertical line of the crosshair, only the x value will change, and the y-value will remain the same). We need this for our application as we are using the crosshair for the user to graphically input data into the graph, but the y-value must be able to stay the same, if the user only wants to change the x-value.
I was trying to do this by overriding the onTouchDown to check if it is near the x or y line from the crosshair, and then setting a "selectionMode" (kind of like zoomMode) to a single axis so SelectionMode.x or SelectionMode.y or SelectionMode.xy or SelectionMode.none (if not near the crosshair)
After that, I override the onTouchMove method so that if selectionMode is set to x for example, then only the x-value will change, etc.
I have uploaded a sample extension class that showcases this.
Kind regards, Luca
I am aware that I might be able to use the chart interaction callbacks, and I've tried this solution, but it turns out to be very buggy in combination with the onCrosshairPositionChanging callback.