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

How to programmatically pan a ColumnSeries bar chart

Thread ID:

Created:

Updated:

Platform:

Replies:

117652 Nov 24,2014 12:33 PM UTC Nov 25,2014 01:05 PM UTC WinRT 1
loading
Tags: SfChart
Mark Riley
Asked On November 24, 2014 12:33 PM UTC

I have a bar chart with a Numerical y-axis and a Category x-axis.

Due to the large number of categories on the x-axis, I had to implement scrolling using the following behaviour:

<chart:SfChart.Behaviors>
       <chart:ChartZoomPanBehavior EnablePanning="True"/>
</chart:SfChart.Behaviors>

and also setting the 'ZoomFactor' on the CategoryAxis appropriately.

This works great, and you can scroll along with the mouse or by touch. However I also need to scroll the chart programmatically. So for example if I have a ZoomFactor of 0.5, I can see the first 50% of the bars. I want to then programmatically show the second 50% of the bars (i.e. without using the mouse or touch).

I can't see how to do this, so any help would be appreciated.

Magesh Kumar Krishnan [Syncfusion]
Replied On November 25, 2014 01:05 PM UTC

Hi Mark,

Thanks for using Syncfusion products.

 

SfChart provides the API called ZoomPosition for panning, we can use this property for programmatic panning requirement. It takes the values from 0 to 1. You can define the ZoomPosition property as in below code snippet.

 

Code snippet:

 

<chart:CategoryAxis Name="primaryAxis" EnableScrollBar="False" ZoomFactor="0.3" ZoomPosition="0.5" FontSize="20">

  </chart:CategoryAxis>

 

Please refer the link given below.

Link : http://help.syncfusion.com/ug/wpf/default.htm#!documents/zoomingandpanning.htm

 

We have prepared sample based on your requirement . please find the sample in the attachment.

Please let us know if you have any queries .

 

Thanks,

Magesh Kumar K


Attachment: ZoomPosition_af7f114a.zip

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

;