ChartTitleText Property

Gets or sets the text of the chart title. If null or empty value is specified, auto generated title will be shown.

Namespace:  Aspose.Words.Drawing.Charts
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public string Text { get; set; }

Property Value

Type: String
Remarks
Use Show option if you need to hide the Title.
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