Groups | Blog | Home
all groups > sql server reporting services > october 2005 >

sql server reporting services : stacked column chart issue


Jordan
10/16/2005 11:37:41 PM
Hi,

I have a stacked column chart in my report. Currently the chart are
stacked by Item No. in ascending order, when I changed the order to
descending (properties tab), instead of sequence change, the color also
changes. Is there a way to retain the color when changing the sequence?

Thanks.

--- Jordan
Robert Bruckner [MSFT]
10/17/2005 7:03:21 PM
You would need to use expressions to explictly set colors based on the
series grouping value. Alternatively, you could follow the approach of
defining your own custom palette discussed in this article:
http://blogs.msdn.com/bwelcker/archive/2005/05/20/420349.aspx. Note: you
won't need the part about the custom legend - just the custom color palette
part.

-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.

[quoted text, click to view]

Jordan
10/17/2005 9:46:55 PM
Hi,

Thanks for your reply. My chart is set up differently from the
conventional way. I have rearranged my dataset to produce the result
required by the user. I managed to get it all working alright, in fact
i am currently making use of the Custom Legend from the link given
above to achieve the result.

Now my users want to change the sequence of how the items are stacked.
Instead of Item A at the bottom, they want to see Item Z on the bottom.
So I went to the Properties of my Series Grouping and set the Sort
order. However, doing this not only change the sequence but also the
color representing the items.

Is there a way to change the sequence of the stacked item without
changing the color representation? Or maybe I am doing it the wrongly?

Please help. Thanks.

--- Jordan
Robert Bruckner [MSFT]
10/19/2005 8:14:42 PM
Instead of the hashtable approach described in the article, you should use
hard-coded color settings so that even if the sort order changes, a specific
series keeps its assigned color. The custom code would then need to look
similar to this:

Public Function GetColor(ByVal groupingValue As String) As String
If groupingValue = "Item A" Then
Return "Red"
Else if groupingValue = "Item B" Then
Return "Green"
Else if
...
End If
End Function

-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

Jordan
10/26/2005 7:01:17 PM

Thanks, I now have an idea of how to go about doing it.

Jordan
AddThis Social Bookmark Button