ChartTitle Class

Provides access to the chart title properties.
Inheritance Hierarchy

Namespace:  Aspose.Words.Drawing.Charts
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.5
public class ChartTitle

The ChartTitle type exposes the following members.

Public propertyCode exampleOverlay
Determines whether other chart elements shall be allowed to overlap title. By default overlay is false.
Public propertyCode exampleShow
Determines whether the title shall be shown for this chart. Default value is true.
Public propertyCode exampleText
Gets or sets the text of the chart title. If null or empty value is specified, auto generated title will be shown.
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)
Shows how to insert a chart and change its title.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Use a document builder to insert a bar chart
Shape chartShape = builder.InsertChart(ChartType.Bar, 400, 300);

// Get the chart object from the containing shape
Chart chart = chartShape.Chart;

// Set the title text, which appears at the top center of the chart and modify its appearance
ChartTitle title = chart.Title;
title.Text = "MyChart";
title.Overlay = true;
title.Show = true;

doc.Save(ArtifactsDir + "Charts.ChartTitle.docx");
See Also