Error Occurs while Setting Chart Series Color with Aspose.Slides for Node.js

Hi team,

I’m facing error while setting chart series color.

const chartDataObject = placeHolder.data;
const chartData = shape.getChartData();
const chartSeries = chartData.getSeries();
const fact = chartData.getChartDataWorkbook();
const columnType = shape.getType();
chartDataObject.series.forEach((ele, seriesIndex) => {
    chartSeries.add(fact.getCell(0, 0, seriesIndex + 1, ele.name), columnType);
    const series = chartSeries.get_Item(seriesIndex);
    series.getFormat().getFill().setFillType(aspose.FillType.Solid);
    series.getFormat().getFill().getSolidFillColor().setColor(aspose.Color.RED);
    series.getLabels().getDefaultDataLabelFormat().setShowValue(true);
    // series.getLabels().setNumberFormat('0.0%');
    ele.values.forEach((value, valueIndex) => {
        const dataPoint = series.getDataPoints().addDataPointForBarSeries(fact.getCell(0, valueIndex + 1, seriesIndex + 1, value ? value : 0));
    });
});

Error:

"Error: Could not find method "setFillType(java.lang.Integer)" on class
"class com.aspose.slides.FillFormat". Possible matches:\n public final void com.aspose.slides.FillFormat.setFillType(byte)\n\n at C:\Users\U1291759\Aviation\mabluaa-blueiaviation-api\dist\services\ppt-generate\generator.js:243:38\n at Array.forEach ()\n

@karanmarsh,
Thank you for contacting support.

Please take a look at the following line in your code snippet:

series.getFormat().getFill().setFillType(aspose.FillType.Solid);

Instead you should write it like this:

series.getFormat().getFill().setFillType(java.newByte(aspose.FillType.Solid));

Resolved. Thanks

@karanmarsh,
We are glad that the problem on your end has been resolved. Thank you for using Aspose.Slides for Node.js.