SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

0
0

Hi,

In our application there are several different Chart types. We want to add a slider (similarly in the screenshot) for each chart to zoom it. Have you got any example at all for this purpose or what is the recommended way to do this?

Thanks,

Best Regards,
Charith

Images
  • You must to post comments
0
0

Hi,

You could try to call MouseWheelZoomModifier.OnModifierMouseWheel(…) and pass coordinate of chart center inside the parameter. Or do the same with RubberBandXyZoomModifier.OnMouseDown(…)/OnMouseUp(…), in this case you would achieve controllable zooming level, something like(pseudo code):

var zoomModifier = new RubberBandXyZoomModifier{IsXAxisOnly = true};

var zoomStartPoint = new Point{X= Slider.Value*Chart.ActualWidth/100d, Y=0};
var zoomEndPoint = new Point{X= Chart.ActualWidth - zoomStartPoint.X, Y=0};

zoomModifier.OnModifierMouseDown(new Params{zoomStartPoint });
zoomModifier.OnModifierMouseUp(new Params{zoomEndPoint });

Does above make sense for you?

Best regards,
Yuriy

  • Charith Jayasundara
    Above proposed solution seems to be bit complicated to implement for all our charts. Isn't there any way to simply bind some properties of the chart to a slider (eg: zoomfactor)? Could you please point any example?If it is difficult to implement slider thing, we can just add a dropdown box with (50%, 100%, 150% ..) if there is any easier approach to implement this.And also, if you are going to implement any better way to do this in near future we can wait until that.
  • Yuriy
    Unfortunately, there isn't any way in which you could just bind some properties and zoom chart in and out. But you can easily create your own modifier which will do that :) Just wrap the code from previous post by modifier class. Also, there is IAxis.ZoomBy(..) method, which is used internally by MouseWheelModifier, you could consider using of it for your purpose.
  • You must to post comments
0
0

Hi Charith,

We created an article on this topic on our new support site. Please, find it here: How to create a Zoom Slider

If it is still topical, it would be great to receive a feedback from you!

Best regards,
Yuriy

  • You must to post comments
0
0

Hi,
The link How to create a Zoom Slider still exist? Am also trying to create a similar feature for my app using scicharts.Can you please provide any link ?

Thanks in Advance,
Chaya

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.