Chart Axis Background color

Hi Everyone,



I’m trying to set the axis’ background color to white.
In the file attached screeShot112.png is what i have and screeShot113.png file is what i want.

The code i have is :

chart.getWalls().setBackgroundColor(Color.getWhite());
chart.getWalls().setForegroundColor(Color.getWhite());
chart.getWalls().getBorder().setVisible(false);
chart.getFloor().setBackgroundColor(Color.getWhite());
chart.getFloor().setForegroundColor(Color.getWhite());
chart.getFloor().getBorder().setVisible(false);

any help would be greatly appreciated
Benoit

Hi,


Thanks for the screen shot and sample code.

Could you only try to use setForegroundColor() method and do not use setBackgroundColor() method.

If you still find the issue, kindly attach the template Excel file containing the underlying chart, so we could evaluate your issue using your file.

Thank you.

Hi,


Thanks Amjad Sahi for the fast answer.

Unfortunately it doesn’t work, i attached my xls file.

Thanks again
Benoit

Hi Benoit,

Thanks for your posting and using Aspose.Cells.

Please see the following sample code. It sets the Walls as no formatting and achieve your desired output. I have attached the output Excel file generated by this code for your reference.

Java


String filePath = “F:\Shak-Data-RW\Downloads\RapportSuiviAvancement_15_01_09_03_48_26.xls”;


Workbook workbook = new Workbook(filePath);


Worksheet worksheet = workbook.getWorksheets().get(“Rapport”);


Chart chart = worksheet.getCharts().get(0);


chart.getBackWall().setFormatting(FormattingType.NONE);


chart.getSideWall().setFormatting(FormattingType.NONE);


chart.getFloor().setFormatting(FormattingType.NONE);


chart.getFloor().getBorder().setFormattingType(ChartLineFormattingType.NONE);


workbook.save(“output.xls”);


It works fine !


Thanks a lot for your fast and sharp help !

Bye
Benoit