Chart for .NET / User's Guide / Axes / Scale / Scale Configurators / Scale Title

Scale Title

Each scale configurator has a Title property allowing you to control the title of the axis. The following code will change the title of the primary Y axis:

C#
Copy Code
NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
NAxis primaryY = chart.Axis(StandardAxis.PrimaryY);
primaryY.ScaleConfigurator.Title = "Axis Title";
Visual Basic
Copy Code
Dim chart As NCartesianChart = NChartControl1.Charts(0)
Dim primaryY As NAxis = chart.Axis(StandardAxis.PrimaryY)
primaryY.ScaleConfigurator.Title.Text = "Axis Title"
 Title Offset

The title offset allows you to indent the title from the scale labels and ticks by a given amount. The following code will indent the label 10 pixels away from the nearest scale decoration (label or tick):

C#
Copy Code
NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
NAxis primaryY = chart.Axis(StandardAxis.PrimaryY);
NScaleConfigurator scaleConfigurator = primaryY.ScaleConfigurator;
scaleConfigurator.Title.Text = "Axis Title";
scaleConfigurator.Title.Offset = new NLength(20, NGraphicsUnit.Pixel);
Visual Basic
Copy Code
Dim chart As NCartesianChart = NChartControl1.Charts(0)
Dim primaryY As NAxis = chart.Axis(StandardAxis.PrimaryY)
Dim scaleConfigurator As NScaleConfigurator = primaryY.ScaleConfigurator
scaleConfigurator.Title.Text = "Axis Title"
scaleConfigurator.Title.Offset = New NLength(20, NGraphicsUnit.Pixel)
 Related Examples
Windows Forms: Axes \ General \ Axis Titles
See Also