This is a migrated thread and some comments may be shown as answers.

Change Series Chart Color

5 Answers 387 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Some
Top achievements
Rank 1
Some asked on 12 Dec 2011, 07:49 PM
Hello,
I am struggling here....  I have created a simple barchart on my report literally all I have done is set the datasource, set the columns to pull the x and y coordinate values from, removed the legend, removed the chart title and applied a "Deep Red" skin.  Now I want to change the color of the bars on the bar graph to a green.  I am not having any luck it seems the skin is overriding my custom setting and while I have seen references to a SkinsOverRideStyles property on the chart in the forums I have been unable to locate it.  Any help is appreciated I am know I am close and the answer is simple it is just not obvious to me.

Thanks for any help in advance.

5 Answers, 1 is accepted

Sort by
0
Some
Top achievements
Rank 1
answered on 13 Dec 2011, 12:09 PM
If it is not possible to change the series color if a skin has been applied then how can I take an existing skin and modify it?  I tried decompiling the .dlls but I can't seem to find them although I know they are in there somewhere.  Again any help is appreciated.
0
Elian
Telerik team
answered on 13 Dec 2011, 12:47 PM
Hi Some,

As you have assumed, the skin overrides many of the the settings (not just the colors).
So, to avoid that you should set the properties you need programmatically in the code-behind (after the InitializeComponent() method in the constructor).

Kind regards,
Elian
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Some
Top achievements
Rank 1
answered on 13 Dec 2011, 08:55 PM
Elian,
Thanks for the tip.  Is there any way for me to grab the built in skin that I like and tweak it slightly and give it a new name?  I expect I will want to apply this format to many different pages and would rather not build a skin from the ground up myself if there is one I would like to adjust slightly.

Thanks,
Nick
0
Elian
Telerik team
answered on 14 Dec 2011, 01:23 PM
Hello Nick,

There is no conventional way to get the skins. However, I'd suggest to create a method that sets the styles that you need in addition and call it after the InitializeComponent(). It isn't as good as using a predefined skin but will still do the job. In the meantime we would considered including out of the box way to prevent the skins from overriding your styles for subsequent version.

Best wishes,
Elian
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Steve
Telerik team
answered on 14 Dec 2011, 04:17 PM
Hi Nick,

This is a quick follow up to let you know that we found the "missing part". Whenever you're using a skin that sets the FillType to ComplexGradient, you would need to override it manually in order for the series color to be respected. Here is an example:

this.RadChart1.Series[0].Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Solid;
this.RadChart1.Series[0].Appearance.FillStyle.MainColor = System.Drawing.Color.Red;

Greetings,
Steve
the Telerik team

Q3’11 of Telerik Reporting is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Tags
General Discussions
Asked by
Some
Top achievements
Rank 1
Answers by
Some
Top achievements
Rank 1
Elian
Telerik team
Steve
Telerik team
Share this question
or