Change the color of the bars in the bar chart

6 posts, 1 answers
  1. Paul
    Paul avatar
    108 posts
    Member since:
    Jun 2010

    Posted 30 Oct 2012 Link to this post

    I have one series.  I need different colors.  I am not using a legend where this would be a problem.  Is this possible?

    [EDIT]
    Before someone asks why, it's because the series is a metric that has a goal (e.g. total sales).  The bars are monthly.  So the chart might be titled "total sales" and the bars are for "Jan", "Feb", "Mar", etc.  Each bar is supposed to be red if far below goal, yellow when near the goal, and green when at or past the goal.  
  2. Answer
    Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 31 Oct 2012 Link to this post

    Hello Paul,

    Could you please examine this online demo and tell me if any questions?

    Greetings,
    Hristo Germanov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Gary
    Gary avatar
    6 posts
    Member since:
    Nov 2007

    Posted 18 Dec 2012 Link to this post

    Is there way to change the color of a single bar from the seriesClick event? 

    I'm using the "e.category" to populate a grid with additional details and would like visual feedback to the user on what what was selected within the chart.
  4. Hristo Germanov
    Admin
    Hristo Germanov avatar
    703 posts

    Posted 19 Dec 2012 Link to this post

    Hello Gary,

    In order to achieve your goal you need to set the color to the dataitem and then you can update the chart datasource.

    For your convenience you have examine this jsbin which implements the suggested approach.

    Regards,
    Hristo Germanov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  5. Andrew
    Andrew avatar
    1 posts
    Member since:
    Sep 2014

    Posted 07 Apr 2015 in reply to Hristo Germanov Link to this post

    Please see this JSFiddle where I have used your example to change the bar color.  However, the series color is wrong. Please advise?

     

    http://jsfiddle.net/1ycxL3fo/

  6. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 10 Apr 2015 Link to this post

    Hi Andrew,

    Please take a look at this forum thread which discussed the same topic.

    Regards,
    Iliana Nikolova
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top