Multi colours in column chart. RRS feed

  • Question

  • Hi everyone! I am new to creating reports using ReportViewer control. I have faced one problem when I created a column chart in .rdlc report (example: chart about the number of cities in continents such as Asia, Africa, Europe...). All the columns are the same colour. I've use expression to write the code so that each column (continent name) is assigned one different colour. The code is:

    Code Block

    =IIf(Fields!Continent.Value = "Africa", "black", IIf(Fields!Continent.Value = "Asia", "yellow", IIF(Fields!Continent.Value = "Europe", "green", IIF(Fields!Continent.Value = "Oceania", "blue", IIF(Fields!Continent.Value = "North America", "brown", "orange")))))



    It works but I know i'ts is a very silly code snippet . So, is there any solution to this problem?


    I am looking forward to reading the replies from you!


    Thanks in advanced !

    Friday, November 9, 2007 9:43 AM


All replies