We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ChartZoomPanBehavior / DoubleTap

Thread ID:

Created:

Updated:

Platform:

Replies:

119017 May 5,2015 02:28 PM UTC Jun 23,2015 05:06 AM UTC Xamarin.Forms 14
loading
Tags: SfChart
Mark Hatton
Asked On May 5, 2015 02:28 PM UTC

I want to create custom behaviour when a chart is double tapped.

I can add my own (conventional) TapGestureRecognizer to the chart view but it never gets fired so I'm assuming SFChart "hogs" this event and will only let me use the default behaviour.

I even tried creating my own ChartBehaviour:

public class ChartDoubleTapBehaviour :  ChartBehavior  

Is there any way of hijacking the double tap event on  ChartZoomPanBehavior  to customize the response to it? It looks like I just have to accept your default behaviour?




Yuvaraj Palanisamy [Syncfusion]
Replied On May 6, 2015 11:02 AM UTC

Hi Mark,

Thanks for using Syncfusion products.

We would like to let you know that you can achieve your requirement by inheriting ChartZoomPanBehavior class, and you can customize the gestures by override the required methods. We have also prepared a sample to customize the double tap gesture on ChartZoomPanBehavior,

Please find the sample from the following location.

Sample: http://www.syncfusion.com/downloads/support/forum/119017/CustomZooming923233549.zip

Please let us know if you require further assistance on this.

Thanks,
Yuvaraj P

Mark Hatton
Replied On May 6, 2015 03:52 PM UTC

Thanks, that works.

Yuvaraj Palanisamy [Syncfusion]
Replied On May 7, 2015 11:55 AM UTC

Hi Mark,

Thanks for the update. Please let us know if you require further assistance on this.

Thanks,
Yuvaraj P

Alexander
Replied On June 16, 2015 05:30 PM UTC

hi  Yuvaraj :D

sorry if this can't do, but I want to know how to do the same in XAML jejeje 

this part:
   ChartDoubleTapBehavior zoom = new ChartDoubleTapBehavior
             {
                 EnablePanning = true,
                 EnableZooming = true,
             };
          
            chart.ChartBehaviors.Add(zoom);



apologies for the inconvenience

Yuvaraj Palanisamy [Syncfusion]
Replied On June 17, 2015 07:27 AM UTC

Hi Alexander,

We request you to use the following code snippet to initialize custom zoom behavior in XAML page,


[XAML]

 

Declaring namespace

xmlns:chart="clr-namespace:Syncfusion.SfChart.XForms;assembly=Syncfusion.SfChart.XForms"   xmlns:local="clr-namespace:SimpleSample;assembly=SimpleSample"

Adding custom behavior

<chart:SfChart.ChartBehaviors>
      <local:ChartDoubleTapBehavior  EnablePanning = "true"  EnableZooming = "true"/>
 </chart:SfChart.ChartBehaviors>


Please let us know if you require further assistance.

Thanks,
Yuvaraj P
 

Alexander
Replied On June 17, 2015 02:40 PM UTC

Hi Yuvaraj 

I was too close, thanks for that, but when I zoom the Labels on the top of the columns instead of become big, they become small

To take advantage of topic, the the aesthetics of the charts is small, the data is not appreciated properly on the screen of the device, is there a way to improve the visual part of the chart?

Thanks a lot

Yuvaraj Palanisamy [Syncfusion]
Replied On June 18, 2015 11:28 AM UTC

Hi Alexander,

In the Chart zooming feature it is used to view the data points clearly when more number of data plotted on the Chart, for this Chart range only will get zoomed and the elements like data markers, data marker labels will not be zoomed and it remains the same size (not small), this is the design of Chart zooming feature.

Would you like to get the data marker labels also zoomed?

Please let us know if you need any further assistance on this.

Thanks,
Yuvaraj

Alexander
Replied On June 18, 2015 02:15 PM UTC

Hi Yuvaraj

That would be great. I don't know if I need to open a new thread to talk about the design, I mean, the labels of X, Y and values are too small, I can't read them well in my phone. Is there some way to appreciate the data a little better ?

Thanks a lot

Alexander
Replied On June 18, 2015 09:37 PM UTC

I am again jeje

I have another question, the chart zooming feature is just for some charts? I implemented it in a Stacking Columns Chart and when I did zoom, the middle label froze in the screen (attached file)

Thanks


Attachment: Screenshot_20150618151649_9ad75ab8.zip

Yuvaraj Palanisamy [Syncfusion]
Replied On June 19, 2015 09:06 AM UTC

Hi Alexander,


We can change the font size of the axis labels and data marker using the below code snippet.


C#


//Used to change the size of axis label font size

sfChart.PrimaryAxis.LabelStyle.Font = Font.SystemFontOfSize(30);


//Used to change the size of data marker label font size

columnSeries.DataMarker.LabelStyle.Font = Font.SystemFontOfSize(30);










                   

 

 

We have analyzed the reported issue with Stacking column data marker label position and it has been already fixed in the latest service pack release. So we request you to use the latest version of Syncfusion Xamarin Studio which is available from the following link.


Link: http://www.syncfusion.com/forums/119275/essential-studio-2015-volume-1-service-pack-2-release-v13-1-0-30-available-for-download    


Please let us know, if you need any further assistance.


Thanks,

Yuvaraj P


Alexander
Replied On June 19, 2015 09:33 PM UTC

Hi Yuvaraj

thanks for your helping, now I am able to change the size (I am so happy because I colud transcript it to xaml wiii), could you help me with the zoom of labels too

thanks for all, you are amazing

Yuvaraj Palanisamy [Syncfusion]
Replied On June 22, 2015 10:26 AM UTC

Hi Mark,

Thanks for the update.

Could you please confirm us whether your requirement is to zoom the data marker labels while performing the zooming on Chart?

Thanks,
Yuvaraj

Alexander
Replied On June 22, 2015 02:32 PM UTC

Hi Yuvaraj

yes, the labels keep in the same position now :D It's working perfectly 

very thanks n.n

Yuvaraj Palanisamy [Syncfusion]
Replied On June 23, 2015 05:06 AM UTC

Hi Alexander,

Thanks for the update.

Please let us know if you need any further assistance on this.

Thanks,
Yuvaraj

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;