Free Support Forum - aspose.com

Range Charts in Word

Hi,

I am trying to create Range and Median charts dynamically and insert them into word documents.

I am able to create bar charts but not Range charts.

There is no option to create NSeries in word.

Can anybody please tell me how to do it in Aspose.Words.

Thanks

Hi

Thanks for your request. "Charts" are the embedded OLE objects. Unfortunately, Aspose.Words can’t add the embedded objects into Word document yet. You can only extract the OLE embedded objects from the document using Aspose.Words.

Best regards.

Hi,

Thanks for the response.

I have still not been able to get a clear solution.

Currently I am able to insert a bar chart into my word document by using the following code.

Chart chart = new Chart();

Series s = new Series();

s.ChartType = ChartType.Bar ;

s.DataPoints.Add(1, new Object[] { 56, 60,70 });

s.DataPoints.Add(2, new Object[] { 40,50, 60 });

chart.SeriesCollection.Add(s);

Bitmap chartBitmap = chart.GetChartImage();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.InsertImage(chartBitmap);

But i am not able to set

s.ChartType = ChartType.BarStacked;

Is there any way i can achive the above.

Thank you.

Hi,

Thanks for considering Aspose

Please try for your need (Make use of one or both of these lines in red for your requirements):

Series s = new Series();

s.ChartType = ChartType.Bar ;

s.CustomAttributes.IsBarStacked = true;

s.CustomAttributes.BarOverlap = 100;

s.DataPoints.Add(1, new Object[] { 56, 60,70 });

s.DataPoints.Add(2, new Object[] { 40,50, 60 });

chart.SeriesCollection.Add(s);

Thank you.