Chart Class

Provides access to the chart shape properties.

ExpandedInheritance Hierarchy

SystemObject
  Aspose.Words.Drawing.ChartsChart

Namespace:  Aspose.Words.Drawing.Charts
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 21.11.0

ExpandedSyntax

public class Chart

The Chart type exposes the following members.

ExpandedProperties

  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.

ExpandedMethods

  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)

ExpandedExamples

Shows how to insert a chart and set a title.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a chart shape with a document builder and get its chart.
Shape chartShape = builder.InsertChart(ChartType.Bar, 400, 300);
Chart chart = chartShape.Chart;

// Use the "Title" property to give our chart a title, which appears at the top center of the chart area.
ChartTitle title = chart.Title;
title.Text = "My Chart";

// Set the "Show" property to "true" to make the title visible. 
title.Show = true;

// Set the "Overlay" property to "true" Give other chart elements more room by allowing them to overlap the title
title.Overlay = true;

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

ExpandedSee Also