Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
195
Programatic set the unscaled values to which to zoom
posted

I want to be able to set the min and max values for both axis on a XamDataChart and zoom into those values (without redrawing the chart). I do not know if it is even possible.

I was able to get the information from the ViewPort when I do a zoom to selection, but I could not reverse the process. Meaning that if I want to zoom into a specific area of the chart by selecting it with the mouse I was able. Now I want to set the values in my app and apply zoom to them. This is what I still could resolve.

Could you help me with this issue?

Parents
  • 1380
    Suggested Answer
    Offline posted

    Hello Martin,

    Only numeric axes have ActualMinimumValue and ActualMaximumValue properties that force the chart to render plot area within specified axis range. So unless you are using Scatter Series (which use two numeric axis) then you cannot be setting these axes properties. Also, setting these properties will prevent end-user from zooming out outside of the specified axes range. Instead, I recommend you using the following properties to zoom the chart to specified region of plot area:

    DataChart.WindowPositionVertical
    DataChart.WindowPositionHorizontal
    DataChart.WindowScaleVertical
    DataChart.WindowScaleHorizontal

    Or just single property which is equivalent to above properties

    DataChart.WindowRect

    Note that these chart's properties will work with any type of axes/series combination.


    The Chart Navigation sample provides an example (in code-behind) how to use above properties. In addition you can find more information about these properties in this help topic.

    Let me know if you have question about chart zooming.

Reply Children
No Data