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
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.
Hi Chris,
I am just checking if my last response was helpful for you. If you need additional assistance on setting the minimum and maximum values of the YAxis, let me know.