We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

NumberFormat on 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 would like to sett the NumberFormat for a Bar Chart. I looked up your example (link):

ChartSeriesEx series = chart.ChartData.Series[0];
series.Labels.NumberFormat = “#,##0.00”;


I don’t have the type ChartSeriesEx available, not in Aspose.Slide dll. So I must use IChartSeries.
Lablels is of type IDataLabelCollection. This type doesn’t have the pProperty NumberFormat for me to set. Please see the attached image of Visual Studio Object Browser!

What am I doing wrong?!

Thank you for your help!




Hi Nasser,

I have observe the requirements and link shared by you. The link that you have shared belongs to old legacy API which is no longer supported. But it has clarified the requirements on your end. I suggest you to please try using the IChartSeries.NumberFormatOfValues property to set the number format on your for Bar chart. I hope this will be helpful. Please share, if I may help you further in this regard.

Many Thanks,

Hello Mudassir,


thank you for your reply, using the new API I found the property.

Setting the property, however still doesn’t change the value in generated PowerPoint slide for me. Here is the workflow I use

  • A single PowerPoint slide is saved on disk with a chart that serves as a “template” (not a POTX, just a normal PPTX!)
  • Slide is loaded using var slide = new Presentation(“PATH”).Slides[0];
  • I load the chart from the slide and manipulate it (change data, set format via NumberFormatOfValues)
  • I add the slide to a new presentation using Slides.AddClone(slide)
In the new slide, NumberFormatOfValues is unchanged (still as in the slide on disk). If this works on your side, I would really appreciate a working sample that I could copy here.

Also, in PowerPoint there is a possibility to set the number of decimal points in the label (please see attached image). Is it possible to set the same value in Aspose?


Best regards

ps in the attached image you see values from the generated presentation. In code I set the format to “#.##0”. In the generated presentation it still is the original value from the “template” on disk which is “#.##0,0”.

Hi Nasser,

I have observed the requirements shared and like to share that there is similar issue shared by you in another forum thread as well and I have shared my feedback for that over this link. Does the shared link suffice your needs or its still an issue. If there is an issue then please share the sample project with us that is reproducing the issue on your end so that I may add ticket for that in our issue tracking system.

Many Thanks,

Hello Mudassir,


the two issues are different, though the both deal with the formating of labels in charts.

The other link (Issue with format of label in a bar chart) is about a single value having the wrong format, while all the other values having the right format.

In this issue, it is about the format NOT being applied.

Here is a description of what I am doing
  • A single PowerPoint slide is saved on disk with a chart that serves as a “template” (not a POTX, just a normal PPTX!)
  • Slide is loaded using var slide = new Presentation(“PATH”).Slides[0];
  • I load the chart from the slide and manipulate it (change data, set format via NumberFormatOfValues)
  • I add the slide to a new presentation using Slides.AddClone(slide)
Thank you for your help!

Hi Nasser,

Thanks for your elaboration. I request you to please provide the template presentation, generated presentation and sample application with us with which you are able to reproduce the issue. I will investigate it and add the issue in our issue tracking system to further investigate and resolve the issue. Please share the requested information so that I may proceed further with my investigation.

Many Thanks,

Hello Mudassir,


please find following a reproduction of the issue I am having. Also I am attaching a screenshot of the settings that I would like to change using Aspose.Slide.

Thank you very much for your effort!

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 slide.Shapes
where shape is IChart && 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”);

// P R O B L E M!!!
// Original Value in the slide on disk is #.##0,0, I am changing this here!
// This change doesn’t appear on the final slide generated
// Also how can I change the number of decimal
chart.ChartData.Series[0].NumberFormatOfValues = “#,##0”;
chart.ChartData.Series[1].NumberFormatOfValues = “#,##0”;
chart.ChartData.Series[2].NumberFormatOfValues = “#,##0”;

var series0 = chart.ChartData.Series[0];
series0.DataPoints[0].Value.Data = 90;
series0.DataPoints[1].Value.Data = 123;
series0.DataPoints[2].Value.Data = 44;
series0.DataPoints[3].Value.Data = 44;
series0.DataPoints[4].Value.Data = 44;

var series1 = chart.ChartData.Series[1];
series1.DataPoints[0].Value.Data = 51;
series1.DataPoints[1].Value.Data = 152;
series1.DataPoints[2].Value.Data = 69;
series1.DataPoints[3].Value.Data = 69;
series1.DataPoints[4].Value.Data = 69;

var series2 = chart.ChartData.Series[2];
series2.DataPoints[0].Value.Data = 68;
series2.DataPoints[1].Value.Data = 147;
series2.DataPoints[2].Value.Data = 54;
series2.DataPoints[3].Value.Data = 54;
series2.DataPoints[4].Value.Data = 54;


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

newPres.Save(Path.Combine(@“FolderOfTheTemplate”, @“FORMATPROBLEM.pptx”) , Aspose.Slides.Export.SaveFormat.Pptx);

Hi Nasser,

Thank you for sharing the code and template file.

I am able to reproduce your mentioned issue after an initial test. Your issue has been registered in our issue tracking system with issue id: SLIDESNET-36058. You will be notified via this forum thread once the issue gets resolved.

Thanks & Regards,

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


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