Trick for turning a single bar in a bar chart a different color than the rest?

CamSmith
CamSmith Domo Employee

I have a basic bar chart and I'd like for one of the bars to be a different color than the rest.  Is this possible?

Best Answer

  • Godiepi
    Godiepi Coach
    Answer ✓

    It depends what you have on your X-axis , usually a Date field, so lets use "Date" on this example.

     

    Lets said you want to show always Yesterday (Bar in Green) and the rest of days (Bars in Blue)

     

    you can do that creating a beastmode that will become your series.

     

    BeastMode: Test

     

    case when `Date` = DATE_ADD(CURRENT_DATE() , interval -1 day) then 'Green' else 'Blue' end

    Domo Arigato!

    **Say 'Thanks' by clicking the thumbs up in the post that helped you.
    **Please mark the post that solves your problem as 'Accepted Solution'

Answers

  • In the Chart Properties area, you can click on Colors and choose the colors you want to use for each bar. By default they'll be different colors, but you can set all of them to be the same and then select the single series you want to be a different color.

     

    See attached screenshot. Hope this helps!

  • CamSmith
    CamSmith Domo Employee

    what about for a single bar chart that only has one series?

  • If it's a single series, I'm not sure how you could change the color of a single bar. I guess we'll both be learning on this thread.

     

    Good luck!

  • Godiepi
    Godiepi Coach
    Answer ✓

    It depends what you have on your X-axis , usually a Date field, so lets use "Date" on this example.

     

    Lets said you want to show always Yesterday (Bar in Green) and the rest of days (Bars in Blue)

     

    you can do that creating a beastmode that will become your series.

     

    BeastMode: Test

     

    case when `Date` = DATE_ADD(CURRENT_DATE() , interval -1 day) then 'Green' else 'Blue' end

    Domo Arigato!

    **Say 'Thanks' by clicking the thumbs up in the post that helped you.
    **Please mark the post that solves your problem as 'Accepted Solution'
  • CamSmith
    CamSmith Domo Employee

    Did the trick.  thanks!

This discussion has been closed.