Chart PlotArea width

I am using slides 16.1.0


I have created a Chart but I cannot change the width of the plot area manually. I have tried using

chart.getPlotArea().setWidth(100)

but it has no effect.

Could you advise how I can change the plot area width.

Other methods on plotArea work as expected such as

chart.getPlotArea().getFormat().getFill().setFillType(FillType.Solid);
Color plotAreaColor = new Color(255,255, 255,10);
chart.getPlotArea().getFormat().getFill().getSolidFillColor().setColor(plotAreaColor);

Thanks

Hi Stephen,


Thank you for posting.

I have observed your comments and like to request you to please try using below sample code on your end to serve the purpose.

chart.setWidth(100);

I hope this will be helpful. Please share if I may help you further in this regard.

Best Regards,

Hi Muhammad


Thank you. The code you have sent is to change the width of the whole chart which works fine. I just want to change the width of the PlotArea inside the Chart.

Thanks

Hi Stephen,


Thank you for explaining.

I have observed your comments and like to share with you the description of setWidth() method. It sets the width of a plot area bounding box as a fraction of the width of the chart (from 0 to 1).
So please try using below code, this is working fine with Aspose.Slides for Java 16.2.0.

chart.getPlotArea().setWidth(0.5);

I hope this will be helpful. please share if I may help you further in this regard.

Best Regards,