Hi
Thanks for your request. As I know Word format has no native charts. As a rule charts are inserted into the word document as embedded OLE objects. Unfortunately Aspose.Words doesn’t allow inserting of OLE objects.
I think that you can use Aspose.Chart component to create graph and then insert it into the word document. For example see the following code:
//Create a sample chart.
Aspose.Chart.Chart lineChart = new Aspose.Chart.Chart();
lineChart.Height = 300;
lineChart.Width = 400;
Aspose.Chart.Series lineSeries = new Aspose.Chart.Series();
lineSeries.ChartType = Aspose.Chart.ChartType.Line;
lineSeries.Name = "Series";
lineSeries.DataPoints.Add(new Aspose.Chart.DataPoint(1, 1));
lineSeries.DataPoints.Add(new Aspose.Chart.DataPoint(2, 2));
lineSeries.DataPoints.Add(new Aspose.Chart.DataPoint(3, 3));
// Fill a series manually
lineChart.SeriesCollection.Add(lineSeries);
//Save chatr in EMF format
MemoryStream ms = new MemoryStream();
lineChart.Save(ms, ImageFormat.Emf);
//Create new document
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
//Insert chart using GetChartImage method
builder.InsertImage(lineChart.GetChartImage());
//Insert chart as EMF
builder.InsertImage(ms);
//Save document
doc.Save(@"Test068\out.doc");
You can read about Aspose.Chart component here:
http://www.aspose.com/documentation/visual-components/aspose.chart-for-.net/product-overview.html
I hope this could help you.
Best regards.
Alexey Noskov
Developer/Technical Support
Aspose Auckland Team