Change the Color in a Chart When the Number Hits a Goal

Comments

3 comments

  • Avatar
    Gary Arnell

    Scott, thanks for the useful post! Several images in the post are showing as broken/missing (see https://screencast.com/t/GWIzHZ987UD). Would you mind checking them? 

    I'm also wondering if something similar can be done with the Table chart-type, i.e. conditional-formatting such that if a cell value is over a particular value, the background of that cell changes.

    0
    Comment actions Permalink
  • Avatar
    Scott Bowen

    Gary, Thanks for letting me know about the broken images. I'm not sure what happened, but I added them back in. 

    Right now we don't have any way to add conditional formatting to a table chart like you're describing, but I can pass your feedback to our product team. I did add this other tip about adding emojis to a table chart that could be helpful.

    0
    Comment actions Permalink
  • Avatar
    Aaron Camacho

    We had a use case to show pre and post-campaign and were able to show the effect of the campaign illustrated by changing the line color at the campaign start date.  Here is what it looked like and the SQL code used to accomplish it. 

    SELECT day,
       -- Pre-Campaign

       CASE
         When day <= '2019-11-08'::DATE THEN views
         end as "Pre-Campaign",
    -- Post-Campaign Start Date
       CASE
         When day >= '2019-11-08'::DATE THEN views
         end as "Post-Campaign Start Date"
    FROM report;

    The first CASE STATEMENT above takes all values in the column "views" that are LESS than or EQUAL to the campaign start date '201-11-08' and puts them into a column named "Pre-Campaign". 

    The second CASE STATEMENT above takes all values in the column "views" that are GREATER than or EQUAL to the campaign start date '201-11-08' and puts them into a column named "Post-Campaign Start Date".

    You then build your chart and select both new columns as your y-axis and select the date column ("day" in this example)  as your x-axis. And Tadaa! You have an amazing chart showing the impact the campaign is taking on overall views.   

    0
    Comment actions Permalink

Please sign in to leave a comment.