Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Another color on specific bar in bar chart

Hi all,

I have a bar chart with date as dimension and count(VAR) for expression.  What I would like to do is using different color for Saturdays and Sundays. 

I have SET DayNames='Mon;Tues;Wed;Thu;Fri;Sat;Sun';


Anyone?


// Fjalar

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

Another technique is to grab the 'Sat' or 'Sun' from the date as follows:

if(

     right(Date (Date,'WWW'),3) ='Sat'

     or

     right(Date (Date,'WWW'),3) ='Sun'

     ,

     <weekendcolor>,

     <weekdaycolor>

)

View solution in original post

5 Replies
rubenmarin

Hi FJalar,

In expressions tab, expand the expression and set in Background Color:

If(weekday(DateField)>=5, Red(), Green())

Switch red and green for the colours you want.

JonnyPoole
Employee
Employee

Another technique is to grab the 'Sat' or 'Sun' from the date as follows:

if(

     right(Date (Date,'WWW'),3) ='Sat'

     or

     right(Date (Date,'WWW'),3) ='Sun'

     ,

     <weekendcolor>,

     <weekdaycolor>

)

Not applicable
Author

Thanks,

Here I got Mondays and Tuesdays colored. 

Not applicable
Author

Thanks!  I'll use this solution.

// Fjalar

JonnyPoole
Employee
Employee

Cool. i rewrote it once or twice before posting and just realized it could be simplified a bit more:

if(

     Date (Date,'WWW') ='Sat'

     or

     Date (Date,'WWW') ='Sun'

     ,

     <weekendcolor>,

     <weekdaycolor>

)