Nevron Forum

Reverse y axis

https://www.nevron.com/Forum/Topic4678.aspx

By Hasindu Diyabalanage - Tuesday, December 28, 2010

Hello peeps,

Would be grateful if any one can help me out.

I need to reverse the scale on the y axis. That is, start from 3 and end with 0. Is this possible?

Many thanks for any replies.
By Nevron Support - Thursday, December 30, 2010

Hi Hasindu,

All axes support invered mode. The following code snippet shows how to invert the primary Y axis (which is the most common case):

NLinearScaleConfigurator scale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
scale.Invert =
true;

By Hasindu Diyabalanage - Monday, January 3, 2011

Many thanks for your reply.

This is the code i now use (below), but unfortunately it does not invert the y axis. Is there something wrong in my code. Please be kind enough to have a look. Thanks

NChart chart = NChartControl1.Charts[0];
NLineSeries line = new NLineSeries();
line.Legend.TextStyle.FontStyle.EmSize = new NLength(9, NGraphicsUnit.Point);
line.Legend.TextStyle.FontStyle.Name = "Calibri";

NLinearScaleConfigurator scale = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;

scale.Invert = true;

line.DataLabelStyle.Format = "";
line.Legend.Format = "
By Nevron Support - Monday, January 3, 2011

Hi Hasindu,

Most likely you override the invert setting by assigning a new scale configurator to chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator later in the code. Can you please check if this is the case?