ChartTitle Class
Provides access to the chart title properties.
Inheritance Hierarchy
SystemObject
  Aspose.Words.Drawing.ChartsChartTitle

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

The ChartTitle type exposes the following members.

Properties
  NameDescription
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.
Methods
  NameDescription
Protected methodCopyComplexPropertiesTo
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
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);

Assert.AreEqual(ShapeType.NonPrimitive, chartShape.ShapeType);
Assert.True(chartShape.HasChart);

// 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