Set Value Label with Formatting on Clustered Column Chart in Node.js

Hi team,

I want to display value label on clustered column chart with decimal point fixed and % sign. Can you please assist us . I’m using aspose slides java with nodejs version.

image.png (1.5 KB)

@karanmarsh,
Thank you for contacting support. I am working on the issue and will get back to you soon.

@karanmarsh,
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNODEJS-59

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@karanmarsh,
Please try using the following code snippet:

var series = chart.getChartData().getSeries();

for (let i = 0; i < series.size(); i++) {
    var ser = series.get_Item(i);
    for (let j = 0; j < ser.getDataPoints().size(); j++) {
        var dataPoint = ser.getDataPoints().get_Item(j);
        dataPoint.getValue().getAsCell().setPresetNumberFormat(java.newByte(10)); // 0.00%
    }
}

Here are the possible preset number format values along with their preset index that can be used:
Chart Formatting|Aspose.Slides Documentation

Hi team,

I’ve checked all possible type of formats. Can you please help me out with my requirement.
image.png (5.8 KB)

image.png (1.2 KB)

This is the format we need.

@karanmarsh,
Could you please clarify why the above solution does not work for you? This will help me understand what you really need.

Because we just do not shift the decimal by two points. We need to format it with some specific type. Please check the image I’ve attached. That kind of custom type we want to apply through aspose.

@karanmarsh,
I am working on your requirements and will get back to you soon.

@karanmarsh,
We have opened the following new ticket(s) in our internal issue tracking system and will consider your question according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESNODEJS-60

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@karanmarsh,
You should use the setCustomNumberFormat instead of setPresetNumberFormat like this:

for (let i = 0; i < series.size(); i++) {
    var ser = series.get_Item(i);
    for (let j = 0; j < ser.getDataPoints().size(); j++) {
        var dataPoint = ser.getDataPoints().get_Item(j);
        dataPoint.getValue().getAsCell().setCustomNumberFormat("[<999950]#.##\"%\";");
    }
}

This worked. Thanks

@karanmarsh,

Good to know that the suggested code segment works for your needs. Feel free to write back to us if you have further queries or comments.