Free Support Forum - aspose.com

Chart series set data range

Aspose Slides for Java 17.10.0

I am using the above version. Is there a way I can set the range of a chart series? Capture.PNG (14.6 KB)

Attached screenshot from PowerPoint that allows to reset the chart series range from the data. Can same be done using Aspose API?

Thanks

@ApiDeveloper,

I have observed your requirements and suggest you to please try using following sample code.

using (Presentation pres = new Presentation())
{
    IChart chart = pres.Slides[0].Shapes.AddChart(ChartType.Line, 10, 10, 400, 300);
    chart.ChartData.SetRange("Sheet1!A1:B4");
    pres.Save("output.pptx", Export.SaveFormat.Pptx);
}

Tried that, it sets the range for the entire chart. However, it resets the color scheme. It would have been great if the formatting was retained once the range is set.

@ApiDeveloper,

I request you to please provide a working sample code that you have used along with source and generated presentations. Please also share the desired output presentation as well. We will investigate the issue further on our end to help you further on provision of requested information.