Chart ZoomStart

Hi,

I'm trying to use the ZoomStart, but I've met some problems.
On UWP, the event is triggered only the first time I zoom.

On Android, it gives me this error : System.Reflection.TargetException: Non-static method requires a target.
Or the chart just doesn't zoom when I set the ZoomStart.

When it will be fixed ?

Thanks

1 Reply

DV Divya Venkatesan Syncfusion Team May 2, 2018 02:37 PM UTC

Hi Torrent, 
 
Query 1: On UWP, the event is triggered only the first time I zoom. 
We have made ZoomStart to work properly by hooking ManipulationCompleted event of chart in Custom Renderer as shown in the below code snippets.  
 
Code snippet [C#]: 
    public class CustomRendererSfChartRenderer 
    { 
        SfChart formsChart; 
        protected override void OnElementChanged(ElementChangedEventArgs<SfChart> e) 
        { 
            base.OnElementChanged(e); 
 
            if (Control != null) 
            { 
                formsChart = e.NewElement as SfChart; 
                Control.ManipulationCompleted += Control_ManipulationCompleted; 
            } 
        } 
 
        private void Control_ManipulationCompleted(object sender, Windows.UI.Xaml.Input.ManipulationCompletedRoutedEventArgs e) 
        { 
            typeof(ChartAxis).GetTypeInfo().GetDeclaredProperty("CanTriggerZoomStart").SetValue(formsChart.PrimaryAxis, true); 
            typeof(ChartAxis).GetTypeInfo().GetDeclaredProperty("CanTriggerZoomStart").SetValue(formsChart.SecondaryAxis, true); 
        } 
    } 
 
Query 2: On Android, it gives me this error : System.Reflection.TargetException: Non-static method requires a target. 
We have prepared a sample by hooking ZoomStart event. The sample works fine and we have attached the sample for your reference. Could you please check with the sample in below location? 
 
 
If still you face the problem, please revert us by modifying the sample based on your application along with replication procedure. This would be helpful for us to serve you. 
 
Regards, 
Divya Venkatesan 


Loader.
Up arrow icon