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

Setting Series Bar Color

1 Answer 46 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 15 Aug 2013, 04:44 PM
Pulling what little hair I have left out.  I need to set the bar color to #4F6E8C or 79, 110, 140 - take your pick. Using VB.NET in codebehind.  All the examples I've found show just using color.xxxxxx to set the color.  That doesn't work for me as the client has very specific colors to use for items which are just not part of the standard color.xxxxx listing.

cbdSeries.Appearance.FillStyle.MainColor   ????????????  
What comes next?  Have had no luck as it only seems to want to use the color.xxxxx or I get a "can't convert...."  Something so simple shouldn't be so hard to find in your documentation.

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 20 Aug 2013, 06:54 AM
Hi Mike,

 You can declare a HEX color through the System.Drawing namespace by using the Drawing.ColorTranslator.FromHtml() method. For example:

Copy Code
Dim colores As Drawing.Color() = { _
Drawing.ColorTranslator.FromHtml("#707070"), _
Drawing.ColorTranslator.FromHtml("#747474"), _
Drawing.ColorTranslator.FromHtml("#E4E4E4"), _
Drawing.ColorTranslator.FromHtml("#E8E8E8") _
}

Then you can assign it to your series via the series.Appearance.FillStyle.MainColor property.

Regards,
Evgenia
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Chart (Obsolete)
Asked by
Mike
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or