Bar Chart's Data Series color not retained

hi,

i was succesfully able to create a editable ppt using aspose.cells and aspose.slides.

for this i have used a standard template excel (where one sheet is having data and other is a chart sheet containing a chart for the given data) and on this excel i have put data programatically and generated a chart image.i also placed this in the ppt.

so far so good... but when double clicked on the chart image i am getting a excel sheet(Template sheet). but it is not having any color for the data series (i.e.. the bars)

for the image i am assigninng the color programatically also.

chart.NSeries[0].Area.ForegroundColor = System.Drawing.Color.FromArgb(179, 5, 56);

the image that is being generated has color for the data series that is specified in the template excel's chart sheet.

what am i missing here? help me.

Regards,

Raghavendra.

Hi,

Well, your need to add your custom colors to MS Excel Standard Color Palette first, before setting it as color for different objects. Since the Excel color palette has only 56 colors (0-55 indexed) on it, so if a color is not there, you will add the color to the palette replacing any existing color on a specified index position using Workbook.ChangePalette() method.

e.g..,

Please add a line before setting the nseries foreground color:

workbook.ChangePalette(System.Drawing.Color.FromArgb(179, 5, 56), 55);

For further reference, please check the document: http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/colors-and-palette.html

Thank you.