Formating bar chart labels as currency

AsposeBarChartFormating.zip (431.8 KB)
Hi Team,
We are using aspose.words to generates word documents from word template. Result document includes bar charts . On this bar chart we trying to show labels with value as currency type
ChartDataLabelCollection labels = series0.DataLabels;
// specify format value label as £2,234.12
labels.NumberFormat.FormatCode = “£#,##0.00”;
labels.ShowValue = true;
labels.ShowLeaderLines = false;
labels.ShowSeriesName = false;
labels.ShowLegendKey = false;
labels.ShowCategoryName = false;
;

Unfortunately the final merged document is not showing required label in required format. The result is : 793100.1743

Regards
Zenon

@cleveradviser

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the expected output Word file that shows the desired behavior.
  • Please create a standalone console application ( source code without compilation errors ) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hi Tahir,

As required all files are in the zip attachment.

Input and output file should read from d:\ drive. But You can change this as wish in console app.

Regards

ZenAsposeBarChartFormating.zip (431.8 KB)

@cleveradviser

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-19204. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@cleveradviser

Thanks for your patience. It is to inform you that the issue which you are facing is actually not a bug in Aspose.Words. So, we have closed this issue (WORDSNET-19310) as ‘Not a Bug’.

To get the desired output please use following set of properties for a ChartDataLabelCollection:

ChartDataLabelCollection labels = chartSeries.DataLabels;

labels.NumberFormat.FormatCode = "\"£\"#,##0.00";
labels.ShowValue = true;
labels.ShowPercentage = false;
labels.ShowLeaderLines = false;
labels.ShowSeriesName = false;
labels.ShowLegendKey = false;
labels.ShowCategoryName = false; 

Setting ShowPercentage to false is important, as well as not assigning NumberFormat.IsLinkedToSource to any value.

The issues you have found earlier (filed as WORDSNET-19204) have been fixed in this Aspose.Words for .NET 20.3 update and this Aspose.Words for Java 20.3 update.