Free Support Forum - aspose.com

Eliminating Datalabels with value 0

Dear all, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

it is possible to eliminate Datalabes with the value 0 in a clustered column chart? I want to show only labels for values greater then 0.

Thanks in advance

Erik

Hi Erik,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

We think the best way is making the cell empty if the value of the cell is zero. Please see the following sample code in this regard:

Workbook workbook = new Workbook();

Cells cells = workbook.Worksheets[0].Cells;

cells["A1"].PutValue(1);

cells["A2"].PutValue(0);

cells["A3"].PutValue(3);

Charts charts = workbook.Worksheets[0].Charts;

int index = charts.Add(ChartType.Column3DClustered, 5, 0, 15, 5);

Chart chart = charts[index];

chart.NSeries.Add("A1:A3", true);

chart.NSeries[0].DataLabels.IsValueShown = true;

cells["A2"].PutValue(null);

workbook.Save(@"C:\dest.xls");

Thank You & Best Regards,

Hi, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the provided code snippet. But it works only in excel. If I save the report in pdf format, 0 values are further displayed.

Please find attached two sample files demonstrating the described behavior.

Regards

Erik

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

We have found your mentioned issue after an initial test. We will look into it and get back to you soon. The issue has been registered in our issue tracking system with issue id CELLSNET-12695.

Thank You & Best Regards,

Hi,

after using the latest provided Aspsoe.Cells version (4.8.1.9) the mentioned issue is solved too.

Thanks & regards

Erik

Hi,

Yes, we have already fixed your mentioned issue in v4.8.1.9.

Thank you.

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.