3 Replies Latest reply: Feb 16, 2015 11:25 AM by Fred Schonenberg RSS

    Bar chart background color based on value not working as expected

    Diego Perez

      Hi all


      for some reason when I try to apply a dynamic background color on a bar chart based on a field it simply doesn't work. I can set it up without problems without conditions, but when I try to do it with an if expression it just doesn't change it. It's like condition is not evaluated at all...

      See screenshots below:


      Bar chart (kind of a gant) with already Status selection to 'Closed' value. Also see my chart properties with colour set to red() for Status='Closed' and not happening at all. (if I put red() in background color it all becomes red without problems)

      gannt chart.JPG


      My Chart properties:


      props.JPGbg color.JPG



      My dimension is the ChangeID (CRQXXXXX) and my expression is duration of this given CRQ (EndTimestamp - StartTimestamp) in hours.
      This CRQs have different Status (Closed, Started, etc... ) and I would love to change background colour based on it for each bar. (if status is closed, then bar is red, and so on).


      If I use an expression like:


      =if (Status='Closed', red(), green())  as Background color for expression all bars become green.

      BTW I've already seen lots of examples from QV community and found nothing that worked for me. I'm using QV11.



      Any Ideas? Any help would be much appreciated.



      PS. Also was wondering if it's possible to get bold values on axis based on any other field kind of if status is cancelled the CRQXXX on the axis becomes bold. ¿?