1 Reply Latest reply: Sep 14, 2016 4:27 AM by Isabelle Timmermans RSS

    Bar Chart - Color by expression

    Helge Jørgensen

      Hi all,


      I know that similar questions have been asked before and I have tried to follow the suggestions, but I still struggle to define colours to the different bars in my chart.


      I would like to define the different colours to the different measurements in my bar chart (oil and ags) using colour by expression. Oil should be green and gas should be red.


      Hopefully some uf you can help me







        • Re: Bar Chart - Color by expression
          Isabelle Timmermans

          Do you have a dimension (or can you create a dimension) where you can tell if it is gas or oil?

          maybe it also works on a measruement, but i'm not sure, never tried.


          Here is my example:

          I have a dimension "Doelgroep", on which i coloured my measures, like this:


          I used this code for coloring the measures:

          if(Doelgroep = 'Primair',vRed,

          if(Doelgroep = 'Secundair',vBlue))


          I put the code here


          (Op uitdrukking = On expresion || Uiterlijk = Appearance)

          Don;t forget the box "expression is a colorcode" (or whatever it may be in English).


          I declared to variables with the Hex codes, you don't have to do this, It is just a normal Hex code:



          Does this help?