4 Replies Latest reply: Jul 30, 2013 4:04 PM by Michael Solomovich RSS

    Two-Dimensional Pie Chart :-(

    Michael Solomovich

      First, I want to apologize for this sort of question.  I don’t have much respect for the pie charts in general, and even less for the 2-dimensional pies.  But this is what our client has already, and they insist on keeping it.  The problem is with the colors.

       

      The color pallet is the same for the “internal” and “external” pies.  Client wants the pies to have different colors.  For example, internal pie (first dimension) using colors 1, 2, 3, and 4, and the external pie (second dimension) – colors 5, 6, and 7:

        2D_Pie.png

      I tried a variety of approaches in the background color expression, but with no much success.  The internal pie gets all same colors, or the external color repeats the first color of the internal pie.

       

      Appreciate any ideas.

       

      Thanks you,
      Michael

       

      PS: I can do it using combined “object” with overlapping pies, but looking for a cleaner solution, one object.

        • Re: Two-Dimensional Pie Chart :-(
          Alessandro Saccone

          Starting from the second dimension you have to set personalized colours in the expression:

           

          if you have for example

           

          Country (first dim)

          City (second dim)

           

          you have to wtite in the expression:

           

          If(City='new york', rgb(x,y,z),

               ...

               if Country='France', rgb(a,b,c),

               ...

               )

          )

           

          Hope it helps

            • Re: Two-Dimensional Pie Chart :-(
              Michael Solomovich

              Thanks for trying Alex,

               

              I wish it were that's simple...  First, your expression guarantees the same color for internal, and for at least the first external.  Test, and see how it looks.  Second, there is a logical gap - where do you insert conditions for the next city?  Well, I can handle the second one, but it doesn't help.  Besides, we have the same values of the 2nd dimesion within each value of the first dimension.

               

              I'm attaching an example, in case anyone wants to test.  It contains the exact number of values in my dimensions - 4 in Dim1, and 3 in Dim2. 

               

              Thanks,

              Michael

               

              Edit: Using the previously attched example.  Expression starting with Dim2

              if(Dim2='X',

              if(Dim1='A', color(1),

              if(Dim1='B', color(2),

              if(Dim1='C', color(3),

              if(Dim1='D', color(4), color(5))))),

              if(Dim2='Y',

              if(Dim1='A', color(1),

              if(Dim1='B', color(2),

              if(Dim1='C', color(3),

              if(Dim1='D', color(4), color(6))))),

              if(Dim2='Z',

              if(Dim1='A', color(1),

              if(Dim1='B', color(2),

              if(Dim1='C', color(3),

              if(Dim1='D', color(4), color(7)))))

              )))

               

              Results is this, using only colors 1 to 4:

              2D_Pie_2.png

               

              An opposit approach:

              if(Dim1='A',

              if(Dim2='X', color(5),

              if(Dim2='Y', color(6),

              if(Dim2='Z', color(7), color(1)))),

              if(Dim1='B',

              if(Dim2='X', color(5),

              if(Dim2='Y', color(6),

              if(Dim2='Z', color(7), color(2)))),

              if(Dim1='C',

              if(Dim2='X', color(5),

              if(Dim2='Y', color(6),

              if(Dim2='Z', color(7), color(3)))),

              if(Dim1='D',

              if(Dim2='X', color(5),

              if(Dim2='Y', color(6),

              if(Dim2='Z', color(7), color(4))))

              ))))

               

              Gives this, using colors 5 to 7:

              2D_Pie_3.png

              Both worse than no expression at all.