Free Support Forum - aspose.com

Issue with format of label in a bar chart

Dears at Aspose!


I am using Aspose.Slides for .net Version 14.10.0.0. I am using Visual Studio 2013 with .net 4.5 working on a Windows 7 PC.

I am loading an existing PowerPoint slide from disk and changing the data in the chart. All is fine except for one value with the wrong NumberFormat. Following is the code I use to reproduce the case and the example slide.

All labels are ok, except for the very first one. It has two values after the decimal point instead of one like the rest!

Thank you very much for your help!

int defaultWorksheetIndex = 0;
var templatePath = Path.Combine(“FOLDEROFTHETEMPLATE”, 2_saeulendiagramm_3year_5groups.pptx);
var pres = new Presentation(templatePath);
var slide = pres.Slides[0];

var chart = (from shape in reportSlide.Shapes
where shape is T && shape.AlternativeText == “diagramm”
select (IChart)shape).Single();


var fact = chart.ChartData.ChartDataWorkbook;
var series = chart.ChartData.Series;

fact.GetCell(defaultWorksheetIndex, 1, 0, “Modified Category 1”);
fact.GetCell(defaultWorksheetIndex, 2, 0, “Modified Category 2”);
fact.GetCell(defaultWorksheetIndex, 3, 0, “Modified Category 3”);
fact.GetCell(defaultWorksheetIndex, 4, 0, “Modified Category 4”);
fact.GetCell(defaultWorksheetIndex, 5, 0, “Modified Category 5”);

fact.GetCell(defaultWorksheetIndex, 0, 1, “New_Series1”);
fact.GetCell(defaultWorksheetIndex, 0, 2, “New_Series2”);
fact.GetCell(defaultWorksheetIndex, 0, 3, “New_Series3”);

var series0 = chart.ChartData.Series[0];
series0.DataPoints[0].Value.Data = 90.3M;
series0.DataPoints[1].Value.Data = 123.3M;
series0.DataPoints[2].Value.Data = 44.3M;
series0.DataPoints[3].Value.Data = 44.3M;
series0.DataPoints[4].Value.Data = 44.3M;

var series1 = chart.ChartData.Series[1];
series1.DataPoints[0].Value.Data = 51.3M;
series1.DataPoints[1].Value.Data = 152.3M;
series1.DataPoints[2].Value.Data = 69.3M;
series1.DataPoints[3].Value.Data = 69.3M;
series1.DataPoints[4].Value.Data = 69.3M;

var series2 = chart.ChartData.Series[2];
series2.DataPoints[0].Value.Data = 68.3M;
series2.DataPoints[1].Value.Data = 147.3M;
series2.DataPoints[2].Value.Data = 54.3M;
series2.DataPoints[3].Value.Data = 54.3M;
series2.DataPoints[4].Value.Data = 54.3M;


Presentation pres = new Presentation();
pres.Slides.AddClone(slide);

pres.Save(@“FORMATPROBLEM.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);

Hi Nasser,

I have worked with the presentation template and sample presentation used by you. I have been able to observe the issue specified in generated presentation. An issue with ID SLIDESNET-36029 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

Many Thanks,

Hello Mudassir,


thank you very much for your reply.

I notice that it is possible to change the value (text) of the label in the PowerPoint application. Is it possible to do the same using Aspose? That would be a workaround until the issue has been resolved.

Best regards

Hi Nasser,

For the time being you can please try using the following option on your end.

series0.DataPoints[0].Label.AddTextFrameForOverriding(series0.DataPoints[0].Value.Data.ToString());
series0.DataPoints[0].Label.TextFrameForOverriding.Paragraphs[0].ParagraphFormat.DefaultPortionFormat.FontBold=NullableBool.True;
I hope this will work on your end.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-36029) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.