corelibraries-devexpress-dot-xtracharts-dot-charttitlecollection-dot-add-x28-devexpress-dot-xtracharts-dot-charttitle-x29.md
Appends the specified ChartTitle object to the current collection.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public int Add(
ChartTitle title
)
Public Function Add(
title As ChartTitle
) As Integer
| Name | Type | Description |
|---|---|---|
| title | ChartTitle |
A ChartTitle object to append to the collection.
|
| Type | Description |
|---|---|
| Int32 |
An integer value indicating the position at which the new element was inserted.
|
This method adds a ChartTitle object to the end of the collection.
The following code snippets (auto-collected from DevExpress Examples) contain references to the Add(ChartTitle) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-charts-create-model-for-custom-chart-element/CS/CustomChartElementModel/Form1.cs#L125
chartTitle.Text = "Temperature (°F)";
chart.Titles.Add(chartTitle);
winforms-charts-create-real-time-chart/CS/RealTimeChartUpdates/Form1.cs#L14
void Form1_Load(object sender, EventArgs e) {
chartControl1.Titles.Add(new ChartTitle { Text = "Real-Time Charting" });
dataAcquisitionThread.Start();
chartControl1.Titles.Add(new ChartTitle { Text = "Real-Time Charting" });
winforms-charts-create-stacked-bar-chart/CS/Series_StackedBarChart/Form1.cs#L38
// Add a chart title:
chart.Titles.Add(new ChartTitle { Text = "Sales by Products" });
winforms-chart-create-a-3d-pie-chart/CS/3DPieChart/Form1.cs#L47
chartTitle1.Text = "3D Pie Chart";
PieChart3D.Titles.Add(chartTitle1);
PieChart3D.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False;
winforms-charts-create-model-for-custom-chart-element/VB/CustomChartElementModel/Form1.vb#L184
chartTitle.Text = "Temperature (°F)"
chart.Titles.Add(chartTitle)
Dim diagram As XYDiagram = TryCast(chart.Diagram, XYDiagram)
winforms-charts-create-real-time-chart/VB/RealTimeChartUpdates/Form1.vb#L21
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
chartControl1.Titles.Add(New ChartTitle With {.Text = "Real-Time Charting"})
Dim series As Series = New Series()
dataAcquisitionThread.Start()
chartControl1.Titles.Add(New ChartTitle With {.Text = "Real-Time Charting"})
Dim series As Series = New Series()
winforms-charts-create-stacked-bar-chart/VB/Series_StackedBarChart/Form1.vb#L36
' Add a chart title:
chart.Titles.Add(New ChartTitle With {.Text = "Sales by Products"})
' Specify legend settings:
winforms-chart-create-a-3d-pie-chart/VB/3DPieChart/Form1.vb#L43
chartTitle1.Text = "3D Pie Chart"
PieChart3D.Titles.Add(chartTitle1)
PieChart3D.Legend.Visibility = DevExpress.Utils.DefaultBoolean.False
See Also