So got a chart autoscale Y working. My code is complex, but the basic is to set the Minimum and Maximum values of the Y axis with the desired values. This is my code:
My problem now is I cannot attach this method to the mouse wheel zoom or pan behavior of the chart. It seems the OnManipulationDelta and OnPointerWheelChanged Methods contained in the API doc are not supported, or I cannot find a way to use them:
Hi Martin, thanks for your help. I tried a few things but I am not sure what I should do exactly... I tried to trigger my ChartAutoScale Method from the PointerWheelChanged event of the RadCartesianChart but it didn't do anything, I did not troubleshoot too far though.
I was hoping by the doc that I could handle this with the ChartPanAndZoomBehavior and its API methods, because I needed to implement another method on my parent Grid container to prevent a double scroll. The RadCartesianChart is in a scrollView page and if you reach the end of the wheel zoom on the chart it scrolls your page very quickly. This was super annoying and I had to prevent this behavior with this:
I would also suggest that the Telerik Charts have something like this to prevent double scrolling the page.
Finally, even if I disabled my scrollView lock and tried to use the PointerWheelChanged of the RadCartesianChart I couldn't find a way to use it properly. I will revisit this later as at least I have a working setup even if the chart wheel does not autozoom.
Thanks!
Martin Ivanov
Telerik team
commented on 28 Jul 2023, 11:20 AM
Can you tell me what do you mean that the PointerWheelChanged of the chart doesn't do anything? Do you mean the event wasn't invoked or just your ChartAutoScale wasn't updating the Minimum and Maximum properties of the chart? Can you also send over few drawings of the expected result on zoom? Why do you need to recalculate the same Minimum and Maximum on zoom changed? If you send over a sample project that shows your setup I can take a look and see if there is something proper to suggest.
So got a chart autoscale Y working. My code is complex, but the basic is to set the Minimum and Maximum values of the Y axis with the desired values. This is my code:
My problem now is I cannot attach this method to the mouse wheel zoom or pan behavior of the chart. It seems the OnManipulationDelta and OnPointerWheelChanged Methods contained in the API doc are not supported, or I cannot find a way to use them:
<tchart:RadCartesianChart.Behaviors> <tchart:ChartPanAndZoomBehavior ZoomMode="Horizontal" PanMode="Both"/> </tchart:RadCartesianChart.Behaviors>
Error XLS0413 The property 'OnPointerWheelChanged' was not found in type 'ChartPanAndZoomBehavior'.
Error XLS0413 The property 'OnManipulationDelta' was not found in type 'ChartPanAndZoomBehavior'.
Thanks!
Hi Martin, thanks for your help. I tried a few things but I am not sure what I should do exactly... I tried to trigger my ChartAutoScale Method from the PointerWheelChanged event of the RadCartesianChart but it didn't do anything, I did not troubleshoot too far though.
I was hoping by the doc that I could handle this with the ChartPanAndZoomBehavior and its API methods, because I needed to implement another method on my parent Grid container to prevent a double scroll. The RadCartesianChart is in a scrollView page and if you reach the end of the wheel zoom on the chart it scrolls your page very quickly. This was super annoying and I had to prevent this behavior with this:
I would also suggest that the Telerik Charts have something like this to prevent double scrolling the page.
Finally, even if I disabled my scrollView lock and tried to use the PointerWheelChanged of the RadCartesianChart I couldn't find a way to use it properly. I will revisit this later as at least I have a working setup even if the chart wheel does not autozoom.
Thanks!
Can you tell me what do you mean that the PointerWheelChanged of the chart doesn't do anything? Do you mean the event wasn't invoked or just your ChartAutoScale wasn't updating the Minimum and Maximum properties of the chart?
Can you also send over few drawings of the expected result on zoom? Why do you need to recalculate the same Minimum and Maximum on zoom changed?
If you send over a sample project that shows your setup I can take a look and see if there is something proper to suggest.