Chart Class
Provides access to the chart shape properties.
Inheritance Hierarchy
SystemObject
  Aspose.Words.Drawing.ChartsChart

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

The Chart type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleAxisX
Provides access to properties of the X axis of the chart.
Public propertyCode exampleAxisY
Provides access to properties of the Y axis of the chart.
Public propertyCode exampleAxisZ
Provides access to properties of the Z axis of the chart.
Public propertyCode exampleLegend
Provides access to the chart legend properties.
Public propertyCode exampleSeries
Provides access to series collection.
Public propertyCode exampleTitle
Provides access to the chart title properties.
Methods
  NameDescription
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