We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Fixing a Y-axis range at one end but not the other

Hi

Is it possible to fix one end of a range to a particular value, but let the other be automatically determined?

In particular, I have some charts where the Y-axis starts at a negative number even though there are no points that are negative. I would like to ensure that the Y-axis always starts at zero, but I do not wish to work out what the maximum value should be (after all that's why I use your component rather than drawing it myself).

Please advise.


1 Reply

GA Ganesan Syncfusion Team September 13, 2011 05:02 PM UTC


Hi,



Currently we have no option to define one end of the range alone in the AxisRange. However, you can make use of the VisibleRange property to set the range to be visible in the Axis.

// Setting the visible Range in the Chart.
area.PrimaryAxis.IsAutoSetRange = true;
area.PrimaryAxis.VisibleRange = new DoubleRange(1d, 6);
area.PrimaryAxis.Range = area.PrimaryAxis.VisibleRange;
area.PrimaryAxis.RangePadding = ChartRangePaddingType.None;


We have also attached a sample to demonstrate the same. Kindly download the sample from the following link.

ChartAxisAutoSetSetRange1106974994.zip


Thanks,
Ganesan



Loader.
Live Chat Icon For mobile
Up arrow icon