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

line chart zooming grid issue

Thread ID:

Created:

Updated:

Platform:

Replies:

94657 May 26,2010 04:30 AM UTC Jun 1,2010 05:32 AM UTC WPF 6
loading
Tags: Chart
Richard Tang
Asked On May 26, 2010 04:30 AM UTC

I just need to build a simple basic 2D line chart with zooming/panning/scrollbar capability. I find syncfusion wpf chart not very easy because of the following issues:

1, I want the chart to be in zooming mode all the time but I don't want those zoom buttons to show up.

2, when I use ZoomFactor to realize the zooming, I found the axis interval changes with each zooming. With our application, we want to axis scales remains the meaningful numbers. The IsFractionEnabledOnZoom does make the scale looks a little better, but still not the one we want. We want to set the scale fixed all the time, such as 10,20,30,..., and not changing with zooming.

Do you have an example just to make a simple basic line chart with zooming ability on both axises?

Sujitha S [Syncfusion]
Replied On May 26, 2010 05:08 AM UTC

Hi Richard,

Thanks for choosing Syncfusion product.

As a work around, We can achieve your requirement.

I have created a simple sample based on your requirement. Please find the attached sample.

Let me know, If you have any queries.

Regards
Sujitha S




ZoomingAnd Scrolling_12120f98.zip

Richard Tang
Replied On May 31, 2010 06:23 AM UTC

Thanks for the reply. I used the example project and just added the below 2 lines in the button click event and seems the set zooming position does not work for me.

chartArea.PrimaryAxis.ZoomPosition = 10;
chartArea.SecondaryAxis.ZoomPosition = 10;

if I add those before setting ZoomFactor like this it will have no effect:

chartArea.PrimaryAxis.ZoomPosition = 10;
chartArea.SecondaryAxis.ZoomPosition = 10;
chartArea.PrimaryAxis.ZoomFactor = chartArea.PrimaryAxis.ZoomFactor/2;
chartArea.SecondaryAxis.ZoomFactor = chartArea.SecondaryAxis.ZoomFactor/2;


if I add those after setting the ZoomFactor it will always move the scrollbar to the very end, no matter what ZoomPosition value I used.

chartArea.PrimaryAxis.ZoomFactor = chartArea.PrimaryAxis.ZoomFactor/2;
chartArea.SecondaryAxis.ZoomFactor = chartArea.SecondaryAxis.ZoomFactor/2;
chartArea.PrimaryAxis.ZoomPosition = 10;
chartArea.SecondaryAxis.ZoomPosition = 10;

Sujitha S [Syncfusion]
Replied On May 31, 2010 11:15 AM UTC

Hi Richard,

Thanks for choosing Syncfusion product.

ZoomingPosition takes the value only from 0 to 1. I have added a simple sample for your reference.

Let me know, If you have any queries.

Regards
Sujitha S




ZoomingAnd Scrolling_28dd078a.zip

Richard Tang
Replied On May 31, 2010 02:52 PM UTC

Hi, I tried the example. It look like the ZoomPosition was not set for the first time I click the button, but it does positioned at 25 in the following clicks. Is this a bug?

By the way, why do you put the ValueToCoefficient in the constructor? can I use the ValueToCoefficient with ZoomPosition setting so I can change the zoom position to any value any time I want?

Richard Tang
Replied On May 31, 2010 04:09 PM UTC

I think I figured it out. The ZoomPosition need to be set after the ZoomFactor, and the ZoomFactor need to be calculated each time, ValueToCoefficient is not working when range changed.

I don't understand why don't you make the zoom position and zoom range easier to use just like everybody else.

Sujitha S [Syncfusion]
Replied On June 1, 2010 05:32 AM UTC

Hi Ricahrd,

Thanks for choosing Syncfusion product.

I have modified the sample to achieve your requirement.

ValuetoCoeffiecient is used to convert the value to the coefficient value since the ZommFactor takes the range from 0 to 1.

Please find the attached sample.

Regards
Sujitha S



ZoomingAnd Scrolling_6fa787bf.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

;