Setting Series Bar Color

Thread is closed for posting
2 posts, 0 answers
  1. Mike
    Mike avatar
    3 posts
    Member since:
    Aug 2013

    Posted 15 Aug 2013 Link to this post

    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.
  2. Evgenia
    Evgenia avatar
    1437 posts

    Posted 20 Aug 2013 Link to this post

    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.

    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.
Back to Top