Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I've got a stacked bar chart showing sales by region by day for a month. I'd like to be able to show which days are weekends and which are not--I expect the numbers to be lower on weekends, so being able to see dips that are not on a weekend would be helpful.
I tried conditional formatting using the WeekEnd() function but it's not working and I'm not sure if it's the best approach. Any ideas?
The weekend() function returns a timestamp for the last millisecond of the last day of the week. It is not a true/false flag for whether something is a weekend or not. You could use the weekday() function, perhaps to color the bar differently, so a background color expression like this:
if(match(weekday(Date),'Sat','Sun'),lightgray(),blue())
The weekend() function returns a timestamp for the last millisecond of the last day of the week. It is not a true/false flag for whether something is a weekend or not. You could use the weekday() function, perhaps to color the bar differently, so a background color expression like this:
if(match(weekday(Date),'Sat','Sun'),lightgray(),blue())
Thanks John - that's helpful and it works.
It does change the color of the entire bar for each day, though, so I couldn't see my stacked colors in each bar. So instead I used the same expression in the text color property to change the color of the totals displayed at the top of each bar.
Not sure if it's possible, but it would be cool to be able to apply a transparency level to the existing colors, rather than a new single background color.
How about the attached? I had to create a table of colors (R,G,B) for customers instead of using the defaults. If customers are missing from the table, they're assigned a color randomly. I went ahead and made a weekend flag to save time in the chart. Then I assign a transparency value to weekends like you suggested:
if(Weekend,argb(100,R,G,B),rgb(R,G,B))
Sweet