Free Support Forum - aspose.com

How to make NoFill for some area

Hi,

Using Aspose.Cells for java, How cann I enable No Fill for a particular area?

For eg: Suppose I set some fill for chart area, and I want No Fill for Legend area, so that legend box also can have same bg color. How Can I do this?

PatternFill pf1 = new PatternFill();
pf1.setBackgroundColor(wb.getPalette().getColor(30));
pf1.setForegroundColor(wb.getPalette().getColor(30));
chart.getChartArea().getArea().setFill(pf1);

//Itried this , but not working. How can I enable NO FILL
chart.getLegend().getArea().setFill(null);

Thanks
Muhammed

Hi,

Thanks for pointing it out.

I have found the issue regarding setting area’s transparency. We will figure it out and let you know about it soon.

Your issue has been logged into our issue tracking system with an issue id: CELLSJAVA-15205.

Thank you.

Hi,

After further analyzing your issue, we found it is not an issue you did not write the code (for making the legend transparent) accordingly. Actually Area.setFill(null) will eliminate the existing fill formatting (for Texture, Gradient and Patterns). You should use Area.setVisible(false) to set the legend’s area transparent.

i.e.

chart.getLegend().getArea().setVisible(false);

Thank you.

working fine
Thanks