Different colors in charts excel 2003 and 2007

Hello,

I make 2 excel files with chart, one in excel 2003 second in 2007. Use same code, but colors in charts different.

use lib 7.0.2 and try 7.0.3 but no different.

Thank you.

Hi,


Well, that is what the behavior of different MS Excel versions (e.g Excel 2003 and Excel 2007). When you create/add a chart in Excel 2003(XLS file format), it will be created with its default settings (e.g with default color of the data series, bars etc.). Similarly when you create a chart in MS Excel 2007 (XLSX file format), it will created with its default settings.

Using Aspose.Cells’ Charts related APIs set, you may manipulate a chart at every level with your desired colors for your bars/data points or data series etc. See a relevant topic for your help:
http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/setting-charts-appearance.html


Thank you.


Hello,

so I set the color.

java.awt.Color red = new java.awt.Color( 192, 80, 77 );
com.aspose.cells.Color colorRed = Color.fromArgb( red.getRed(), red.getGreen(), red.getBlue() );
chart.getNSeries().get( 0 ).getArea().setForegroundColor( colorRed );

java.awt.Color blue = new java.awt.Color( 79, 129, 189 );
com.aspose.cells.Color colorBlue = Color.fromArgb( blue.getRed(), blue.getGreen(), blue.getBlue() );
chart.getNSeries().get( 1 ).getArea().setForegroundColor( colorBlue );

Why are different colors in different formats Excel?
Before use another library, and colors look the same(Aspose.cells 2.5.4.13).

Hi,


For your information, if you set a custom color for MS Excel 2003 XLS file format, it will be shown as the closest color selected from palette. I think you may try to add the custom color to Excel standard color palette first before setting/using them in the chart. See the topic:

If you are using MS Excel 2007 XLSX file format, you don’t need to do this as MS Excel 2007 XLSX color palette has lots of colors and you don’t need to do this.

Thank you.

Thanks, this helped

Hi,

Thanks for your posting and using Aspose.Cells for Java.

We are glad to know your issue is now resolved. Please feel free to post if you find any other issue. We will be glad to help you further.

Please also check the updated links for your reference.


We will also advise you to download and try the latest Aspose.Cells for Java demos to see the running examples of various enhancements and new features supported by it. It will also help you to fix or upgrade the old code of your existing applications.