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

Free Support Forum - aspose.com

How to set custom DataLabel values from Cell or Formula using getDataLabels().setText or any other API


Is it possible to set DataLabel values from some cell?

String dataLabelRef = "=DataSheet!$B$2 + DataSheet!$B$4";
chart.getNSeries().get(0).getDataLabels().setText(dataLabelRef );

My intension is, instead of showing actual series value, I want to show value from some other cell(or using formula). Is it possible?



Could you create your desired chart (in MS Excel manually) with data labels are obtained by a formula result and post it here. We will check it soon. Moreover, I have a doubt if MS Excel allows this.

I think as a workaround, you may set the formula in some cell in a worksheet, then calculate formulas using API, now get the calculated result(from the formula cell) to save in your variable to set it for label text.

Thank you.


After further investigation, we don’t think MS Excel supports to set such kind of formulas, such as, “=DataSheet!$B$2 + DataSheet!$B$4” for DataLabels. But MS Excel does support to set linked source, such as “=DataSheet!$B$2:$B$4”. So we have provided new APIs for DataLabels: i.e.
to set such kind of linked source. Please try this new fix V2.4.0.3 (attached).

Thank you.

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

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