Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

Axis.Title Property

Provides access to options used to display and format the axis title.

Namespace: DevExpress.Spreadsheet.Charts

Assembly: DevExpress.Spreadsheet.v20.2.Core.dll

Declaration

ChartTitleOptions Title { get; }

Property Value

Type Description
ChartTitleOptions

A ChartTitleOptions object containing display settings for titles on a chart.

Remarks

Use the Title property to access an object exposing the ChartTitleOptions interface, which inherits the ChartText and ShapeFormatBase interfaces. Use this object’s members to display or hide the axis title (by setting the ChartTitleOptions.Visible property), to specify the text for the title (by using the ChartText.SetValue or ChartText.SetReference method), to adjust the position of the title (via the ChartTitleOptions.Layout property) and modify the title appearance (by utilizing the ShapeFormatBase.Fill and ShapeFormatBase.Outline properties).

Example

The following example demonstrates how to create a clustered bar chart and add the title to the value axis using the Axis.Title property, which returns the ChartTitleOptions object containing basic title options. Set the ChartTitleOptions.Visible property to true to display the axis title. To explicitly specify the text for the title, utilize the ChartText.SetValue method.

Dim worksheet As Worksheet = workbook.Worksheets("chartTask2")
workbook.Worksheets.ActiveWorksheet = worksheet

' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.BarClustered, worksheet("B4:C7"))
chart.TopLeftCell = worksheet.Cells("E3")
chart.BottomRightCell = worksheet.Cells("K14")

' Specify the axis title text.
chart.PrimaryAxes(1).Title.Visible = True
chart.PrimaryAxes(1).Title.SetValue("Shipment in millions of units")
' Hide the legend.
chart.Legend.Visible = False
' Specify that each data point in the series has a different color.
chart.Views(0).VaryColors = True
See Also