Defines the common settings of an axis's title.
public abstract class AxisTitle : Title, ITextPropertiesProvider, IHitTest, ISupportTextAntialiasing, ISupportVisibilityControlElement
Public MustInherit Class AxisTitle Inherits Title Implements ITextPropertiesProvider, IHitTest, ISupportTextAntialiasing, ISupportVisibilityControlElement
Related API Members
The following members accept/return AxisTitle objects:
Properties exposed via the AxisTitle class allow you to customize common title attributes, such as:
- the axis title's text (Title.Text),
- the color and font settings of the title's text (TitleBase.TextColor and TitleBase.Font),
- apply antialising (smoothing) to the title's text (TitleBase.Antialiasing),
- the alignment of the axis title (AxisTitle.Alignment),
- the visibility of the axis title (TitleBase.Visible).
At the same time the AxisTitle class represents the base class for the AxisTitleX and AxisTitleY classes that respectively define title settings for axes of X and Y types. The properties and methods which are defined by the AxisTitle class specify the base axis title settings and are common to all axis titles. The only difference in axis titles of the AxisTitleX and AxisTitleY types is in the initialization of the Title.Text property's default value.
For more information, refer to Axis Titles.
This example demonstrates how to access an axis title at runtime.
// Cast the chart's diagram to the XYDiagram type, to access its axes. XYDiagram diagram = (XYDiagram)chartControl1.Diagram; // Customize the appearance of the X-axis title. diagram.AxisX.Title.Visible = true; diagram.AxisX.Title.Alignment = StringAlignment.Center; diagram.AxisX.Title.Text = "X-axis Title"; diagram.AxisX.Title.TextColor = Color.Red; diagram.AxisX.Title.Antialiasing = true; diagram.AxisX.Title.Font = new Font("Tahoma", 14, FontStyle.Bold); // Customize the appearance of the Y-axis title. diagram.AxisY.Title.Visible = true; diagram.AxisY.Title.Alignment = StringAlignment.Center; diagram.AxisY.Title.Text = "Y-axis Title"; diagram.AxisY.Title.TextColor = Color.Blue; diagram.AxisY.Title.Antialiasing = true; diagram.AxisY.Title.Font = new Font("Tahoma", 14, FontStyle.Bold);