Applies to: Nevron Chart for .NET

How to set and adjust the chart axis title?

You can easily display a title to each axis, the scale configurator object assigned to any axis allows you to set and adjust the axis title. Additionally you can set a various properties of its appearance.

The following code shows how to assign a title to an axis and set the most of its properties such as angle between the axis and the title, the offset from the axis etc.

[C#]
//Creating a scale configurator
NLinearScaleConfigurator linearConfigurator = new NLinearScaleConfigurator();
  
//Setting the text of the title.
linearConfigurator.Title.Text = "My Axis";
  
//Setting the angle between the axis and the title.
linearConfigurator.Title.Angle = new NScaleLabelAngle(-90);
  
//Setting the offset of the axis title.
linearConfigurator.Title.Offset = new NLength(50);
  
//Setting the title alignment.
linearConfigurator.Title.RulerAlignment = Nevron.HorzAlign.Right;
  
// Setting the title ruler offset.
linearConfigurator.Title.RulerOffset = new NLength(20, NRelativeUnit.ParentPercentage);
  
//Setting the title content alignment.
linearConfigurator.Title.ContentAlignment = ContentAlignment.MiddleCenter;
  
chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearConfigurator;

[VB.NET]
'Creating a scale configurator
Dim linearConfigurator As New NLinearScaleConfigurator()
  
'Setting the text of the title.
linearConfigurator.Title.Text = "My Axis"
  
'Setting the angle between the axis and the title.
linearConfigurator.Title.Angle = New NScaleLabelAngle(-90)
  
'Setting the title alignment.
linearConfigurator.Title.Offset = New NLength(50)
  
'Setting the alignment of the title on the axis.
linearConfigurator.Title.RulerAlignment = Nevron.HorzAlign.Right
  
'Setting the title ruler offset.
linearConfigurator.Title.RulerOffset = New NLength(20, NRelativeUnit.ParentPercentage)
  
'Setting the title content alignment.
linearConfigurator.Title.ContentAlignment = ContentAlignment.MiddleCenter
  
chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator = linearConfigurator

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