DocumentBuilderInsertChart Method (ChartType, Double, Double)
Inserts an chart object into the document and scales it to the specified size.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.10
Syntax
public Shape InsertChart(
	ChartType chartType,
	double width,
	double height
)

Parameters

chartType
Type: Aspose.Words.Drawing.ChartsChartType
The chart type to insert into the document.
width
Type: SystemDouble
The width of the image in points. Can be a negative or zero value to request 100% scale.
height
Type: SystemDouble
The height of the image in points. Can be a negative or zero value to request 100% scale.

Return Value

Type: Shape
The image node that was just inserted.
Remarks

You can change the image size, location, positioning method and other settings using the Shape object returned by this method.

Examples
Shows how to insert a chart into a document.
[C#]

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.InsertChart(ChartType.Pie, ConvertUtil.PixelToPoint(300), ConvertUtil.PixelToPoint(300));

doc.Save(ArtifactsDir + "Document.InsertedChartDouble.doc");
See Also