Profile Picture

Display all custom labels on a Y axis

Posted By Marina Koronidou 12 Years Ago
Author
Message
Marina Koronidou
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 5, Visits: 1
Thanks very very much! This is exactly was I was looking for!

Thanks again!

Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
Hi Marina,

The solution is to force the Y axis to display a custom range of values (in your case from 0 to 5) regardless of the min max provided by the series.

NChart chart = nChartControl1.Charts[0];

NBarSeries bar = new NBarSeries();
chart.Series.Add(bar);
bar.Values.AddRange(new double[] { 1, 3, 4, 2 });

NOrdinalScaleConfigurator scaleX = chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NOrdinalScaleConfigurator;
scaleX.AutoLabels = false;

NStandardScaleConfigurator scaleY = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NStandardScaleConfigurator;
scaleY.AutoLabels = false;
scaleY.CustomLabels.Add(new NCustomValueLabel(1, "Very poor"));
scaleY.CustomLabels.Add(new NCustomValueLabel(2, "Poor"));
scaleY.CustomLabels.Add(new NCustomValueLabel(3, "Satisfactory"));
scaleY.CustomLabels.Add(new NCustomValueLabel(4, "Good"));
scaleY.CustomLabels.Add(new NCustomValueLabel(5, "Very good"));

chart.Axis(StandardAxis.PrimaryY).View = new NRangeAxisView(new NRange1DD(0, 5), true, true);


The last line makes the Y axis always show the values from 0 to 5. Hope this helps.


Best Regards,
Nevron Support Team



Marina Koronidou
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)Forum Newbie (5 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 5, Visits: 1
Hi there,

I have spend enough hours trying to figure out the following and I would appreciate some help:

I have a NStandardScaleConfigurator scaleY as below:
NStandardScaleConfigurator scaleY = this._chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NStandardScaleConfigurator;
scaleY.AutoLabels = false;
scaleY.CustomLabels.Add(new NCustomValueLabel(1, "Very poor"));
scaleY.CustomLabels.Add(new NCustomValueLabel(2, "Poor"));
scaleY.CustomLabels.Add(new NCustomValueLabel(3, "Satisfactory"));
scaleY.CustomLabels.Add(new NCustomValueLabel(4, "Good"));
scaleY.CustomLabels.Add(new NCustomValueLabel(5, "Very good"));

and my scale X is as below:
NOrdinalScaleConfigurator scaleX = this._chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NOrdinalScaleConfigurator;
scaleX.AutoLabels = false;

My data are displayed correctly, but when for example the x data have a maximum value of 4, then the
5th Y axis label is not displayed. That is a problem, since I want the user to be able to see all the possible values.

Is there a way to display all the custom y axis labels all the time no matter the x data values?

Thanks
Marina



Similar Topics


Reading This Topic