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. Image for the cookie policy date

line chart zooming grid issue

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?

6 Replies

SS Sujitha S Syncfusion Team 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


RT Richard Tang 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;


SS Sujitha S Syncfusion Team 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


RT Richard Tang 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?


RT Richard Tang 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.


SS Sujitha S Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon