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
1030
Pad axes minimum and maximum values
posted

Hi,

We are using xdatachart with automatic scaling, but is there a way to pad the max and min values of y axis? For example, I have a set of points with min and max value of 100 and 500, I want to set min and max as 50 and 550 where my interval is 50 so that points with 100 and 500 values are visibke properly. My dataset of points keeps on updating with values, so I want to update min and max accordingly.

Thanks

Chris Foster

Parents
  • 17475
    Offline posted

    Hello Chris, 

    Thank you for posting! 

    After reviewing your requirement I have created a sample project where YAxis range is change in code. The following code snippet allows you to update minimum and maximum displayed values whenever the data is changed:

    sortedItems = items.OrderByDescending(item => item.Y).ToArray();

                    (xamDataChart1.Axes["numericYAxis"] as NumericYAxis).MaximumValue = sortedItems[0].Y * 1.1;

                    (xamDataChart1.Axes["numericYAxis"] as NumericYAxis).MinimumValue = sortedItems[sortedItems.Count() - 1].Y * 0.8;

    If you have any questions or concerns please feel free to ask.

    XamDataChartAxisMinMax.zip
Reply Children
No Data