Change the appearance angle of the axis labels

Applies to: Nevron Chart for .NET

How to change the appearance angle of the axis labels?

Changing the appearance angle can be achieved by setting the label style of the axis scale configurator.

[C#]
NLinearScaleConfigurator linear = new NLinearScaleConfigurator();
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linear;
linear.LabelStyle.Angle = new NScaleLabelAngle(30);

[VB.NET]
Dim linear As New NLinearScaleConfigurator()
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = linear
linear.LabelStyle.Angle = New NScaleLabelAngle(30)

Article ID: 67, Created On: 10/6/2010, Modified: 11/15/2010

Comments (1)

David Brown

How can I change the actual font? I've tried everything, no matter what I do the font remains the same. I'm using this code from the linear gauge exasmple

scale.SetPredefinedScaleStyle(PredefinedScaleStyle.PresentationNoStroke);
scale.LabelStyle.TextStyle.FontStyle = new NFontStyle("Arial", 24, FontStyle.Bold);

Please help, trying to do this simple thing takes hours and hours of time, very frustrating

11/17/2012 at 1:20 PM
Christo Bahchevanov

The code is correct – most likely you are not calling refresh on the chart:

NChart chart = nChartControl1.Charts[0];

NLinearScaleConfigurator scale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
scale.SetPredefinedScaleStyle(PredefinedScaleStyle.PresentationNoStroke);
scale.LabelStyle.TextStyle.FontStyle = new NFontStyle("Arial", 24, FontStyle.Bold);

nChartControl1.Refresh();

12/6/2012 at 1:33 PM