Profile Picture

How to manipulate X axis labels

Posted By David Wilson 13 Years Ago
Author
Message
David Wilson
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 2, Visits: 1

Hi,

In this web example for the standard 3D bar chart ( http://examplesaspnetchart.nevron.com/Frames/NExampleFrame.aspx?ExampleUrl=Examples/ChartGallery/Bar/NStandardBarUC.ascx 

How would I change the X axis labels to show the legend values instead?

So instead of seeing 1,2,3 I would see Silverlight, Ajax, JackBe

Thanks!



Nevron Support
Posted 13 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 David,

You can disable automatic labels and use custom value labels, like in the following example:

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

scaleX.CustomLabels.Add(new NCustomValueLabel(0, "Silverlight"));
scaleX.CustomLabels.Add(new NCustomValueLabel(1, "Ajax"));
scaleX.CustomLabels.Add(new NCustomValueLabel(2, "JackBe"));
scaleX.CustomLabels.Add(new NCustomValueLabel(3, "Laszlo"));
scaleX.CustomLabels.Add(new NCustomValueLabel(4, "Java FX"));
scaleX.CustomLabels.Add(new NCustomValueLabel(5, "Flex"));

NBarSeries bar = new NBarSeries();
chart.Series.Add(bar);
bar.Values.AddRange(new double[] { 10, 20, 15, 25, 22, 43 });


Best Regards,
Nevron Support Team



David Wilson
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 2, Visits: 1

Thanks very much, Support Team 

 





Similar Topics


Reading This Topic