Issue with Chart.setPerspective(short) in Java Cells using NodeJS

Hello Aspose Team,

I’ve encounter an issue with Chart.setPerspective() (Class: Chart - Aspose.Cells for Node.js via Java - API Reference).

The issue is that NodeJS seems to be unable to pass short (Int16) to setPerspective.

I tried to call it this way :

const int16Perspective = new Int16Array(1);
int16Perspective[0] = chartDetails.perspective;
console.log("int16Perspective[0]:", int16Perspective[0]);
chart.setPerspective(int16Perspective[0]);

But I got this message :

Could not find method "setPerspective(java.lang.Integer)" on class "class com.aspose.cells.Chart". Possible matches:
      public void com.aspose.cells.Chart.setPerspective(short)

The issue is the same if I call it with ‘Number’ variable or with litteral.

Do you have an idea about how to call it properly ?

Regards,
Thomas

@ThomasP6,

Please try using newShort API/attribute for your needs.

1 Like