We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to change legend entry ?

Hie,

when i generate a chart and change the bars colors, the chart's legend changes as well.

I'm using the following command to change the colors of the bars:

ExcelStyle.Series[oDataSerie.Caption].DataPoints[j].DataFormat.Fill.ForeColor = oDataSerie.Color;

I would like to know if i'ts possible to edit the legend entries and captions so it will look like the original legend, or to prevent the change from happening all together.
I basically need to be able to change individual bars color in a chart without affecting the legend.

I've attached to the post two images, one is the default look with the original legend and the other is the colored one where the legend entries changed.

Thanks.



color_b5c80d2c.zip

3 Replies

SB Sathish Babu R Syncfusion Team April 13, 2010 11:52 AM UTC

Hi Lulian

Thank you for your interest on Syncfusion Products.

Changing the Chart’s bar color is also changes the color of the Legend which is the default behavior of Microsoft Excel. The Essential XlsIO providing the same feature like Microsoft Excel.

Please let us know if you have any questions.

Regards,
Sathish


JB Julian Bercovici April 14, 2010 04:44 PM UTC

Hie,

i don't mind it changing the legend entries color, my problem is that it changed the legend entries text, and added more entries then there were at the begining.

You can see in the "default.jpg" file attached to the original message that the legend has one entry called "OrderQty".
When i change the points color, you can see in the other file, "color.jpg", that the legend entry changed into five entries with different names.
I would like to be able to restore the original single entry with the original name, i don't mind the color since i changed it.

So, could it be done ?

Thanks.


SB Sathish Babu R Syncfusion Team April 15, 2010 06:38 AM UTC

Hi Lulian,

Thank you for your interest in Syncfusion Products.

Suppose we collapsed the chart area. We are able to reproduce it to the original state. The sample is executed and it is recorded as video. Could you please see the below link.

Please let us know if you have any questions.

F93918-2869344.zip

Regards,
Sathish

Loader.
Live Chat Icon For mobile
Up arrow icon