How to manipulate X axis labels


Author
Message
David Wilson
David Wilson
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
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
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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
David Wilson
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
Posts: 2, Visits: 1

Thanks very much, Support Team 

 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search