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

0
0

This might be a stupid question. đŸ˜€ But I tried several things and nothing seems to work…

I have a chart that has several different datasets that can be switched to. When I apply them and do zoom to extents it changes the Y Axis sometimes 1-15, sometimes 1-20, sometimes 1-25. So the chart zooms in/out, which looks nice.

However I would like to fix the initial zoom to be always be 1-20. If the chart is smaller or bigger than 20; that is fine; I just want the initial viewport to always zoom to be 1-20, when I switch the dataset. They can then zoom in/out or pan using gestures.

Any ideas on what API I need to call to zoom the chart to 1-20. (Please note, this is using a logarithmic scale on the Y-Axis — if it makes any differences).

So what do I need to call/set rather than calling the zoom to extents function.

Version
3.0.0
  • You must to post comments
0
0

Hi Nathanael,

I’m not sure how you perform zoom extents in your application, but you just need to set VisibleRange and configure chart to not update it.

Hope this will help you!

Best regards,
Yura

  • Andrew
    To add to this. Zoom extents, always zooms to the extents of your data, always. I would suggest maybe a custom modifier? Override ChartModifierBase and the double tap gesture and set XAxis/YAxis.VisibleRange. We have loads of examples of custom modifiers for WPF, @Yura do we have one for Android?
  • Nathanael Anderson
    I am currently using ZoomExtents() — However, I’m willing to use whatever works best. I don’t want to STOP zooming on the Y axis — I still want the user to be able to zoom it in and out. What I want to do is when I refresh the data, reset the zoom on the Y axis to be 1-20 again. So basically it would act like the zoomExtents command, but always zoom me to a preset Y Axis? Does that make sense?
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.