locked
Legend Colors RRS feed

  • Question

  • I have a stacked column chart and modified the appearance -> Color -> expression to the value =SWITCH(Fields!<>.Value="","Red",Fields!Severity.Value="","Orange",Fields!<>.Value="","Yellow") in order for the columns to show the colors i want. On one particular chart the legend reflects these color correctly but on a second sep. chart it does not. The reason it does not is because I have two category groups in this chart.. Any ideas how to address this? not sure why two category groups breaks this..
    Friday, September 2, 2011 8:44 PM

Answers

  • i was able to fix this by modifying the custom palette to the colors i wanted. This addressed the legend colors issue
    • Marked as answer by Lola Wang Wednesday, September 7, 2011 12:59 AM
    Tuesday, September 6, 2011 8:34 PM

All replies

  • I have a stacked column chart and modified the appearance -> Color -> expression to the value =SWITCH(Fields!ticket.Value="valueA","Red",Fields!ticket.Value="Valueb","Orange",Fields!ticket.Value="valuec","Yellow") in order for the columns to show the colors i want. On one particular chart the legend reflects these color correctly but on a second sep. chart it does not. The reason it does not is because I have two category groups in this chart.. Any ideas how to address this? not sure why two category groups breaks this..

    Friday, September 2, 2011 8:46 PM
  • Hi mparisi100,

    Generally, the number of category groups will not affect the legend color. Based on my test, there might be caused by the improper relationship between the two category groups. So, could you follow these steps to make sure that that is not a bug in your environment:

    1. Create a dataset with following query statement

    select * from (select '2008' as Year, 25 as Amount,'aaa' as subcategory,'001' as Category
    union
    select '2009',20,'aaa','001'
    union
    select '2008',30,'bbb','001'
    union
    select '2009',15,'bbb','001'
    union
    select '2008',25,'ccc','002'
    union
    select '2009',35,'ccc','002'
    union
    select '2008',20,'ddd','002'
    union
    select '2009',30,'ddd','002'
    union
    select '2008',15,'eee','001'
    union
    select '2009',25,'fff','002'
    ) as t1
    Group by Category,subcategory,Year,Amount

    2. Drag the Stacked Column chart to the design surface, configure it as



    3. Click series in chart area to have it selected, then in theAmount Chart Series properties pane, navigate to Appearance—Color—Expression: =Switch(Fields!Year.Value="2008","Red",Fields!Year.Value="2009","Yellow")

    4. Previewing to make sure that it shows the color correctly.

    5. Add another Categrory Groupsubcategory below Category group as

    6. Previewing.

    If the color shows correctly all the time, then we can sure that there might be something wrong in your dataset or other chart configurations. For further assistance, please post more details about your dataset with some sample data and the main steps of configuring the chart.

    Thanks,
    Lola

    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    tnmff@microsoft.com.


    Please remember to mark the replies as answers if they help.
    • Proposed as answer by Lola Wang Monday, September 5, 2011 3:04 AM
    Monday, September 5, 2011 3:03 AM
  • serieschart = count(ticketnumber)

    categorygroups= startyear and startmonth

    seriesgroup=severity

     

    I am using the switch command but it only works if I remove one of the category groups

    Tuesday, September 6, 2011 4:01 PM
  • the chart reflects the colors correctly its just the legend thats wrong
    Tuesday, September 6, 2011 4:06 PM
  • Any help would be appreciated
    Tuesday, September 6, 2011 7:14 PM
  • i was able to fix this by modifying the custom palette to the colors i wanted. This addressed the legend colors issue
    • Marked as answer by Lola Wang Wednesday, September 7, 2011 12:59 AM
    Tuesday, September 6, 2011 8:34 PM