I'm trying to figure out how to create a custom series color in a bar chart,
and am unable to find documentation on it.
I read a post here on trying the Choose() function in the fill color portion
of the series value, but my chart goes gray in the layout mode, and then in
the preview mode it just shows the default colors.
Any documentation on this I can read?Keep in mind that expressions cannot be evaluated in design mode.
From the SP1 Readme about chart enhancements:
http://download.microsoft.com/download/7/f/b/7fb1a251-13ad-404c-a034-10d79ddaa510/SP1Readme_EN.htm#_chart_enhancements
"If you use an expression for fill color, the chart elements will be white
in Layout view, but will display properly when the report is run."
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Matt" <Matt@.discussions.microsoft.com> wrote in message
news:1AA68AB0-128E-44B2-8519-6357D7EBD465@.microsoft.com...
> I'm trying to figure out how to create a custom series color in a bar
chart,
> and am unable to find documentation on it.
> I read a post here on trying the Choose() function in the fill color
portion
> of the series value, but my chart goes gray in the layout mode, and then
in
> the preview mode it just shows the default colors.
> Any documentation on this I can read?|||That makes sense,
But still having an issue of what function to use in the fill color field.
I have
=IIf( Fields!descriptn.Value = "Self", "white","Transparent")
But it seems to ingore it.
"Robert Bruckner [MSFT]" wrote:
> Keep in mind that expressions cannot be evaluated in design mode.
> From the SP1 Readme about chart enhancements:
> http://download.microsoft.com/download/7/f/b/7fb1a251-13ad-404c-a034-10d79ddaa510/SP1Readme_EN.htm#_chart_enhancements
> "If you use an expression for fill color, the chart elements will be white
> in Layout view, but will display properly when the report is run."
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Matt" <Matt@.discussions.microsoft.com> wrote in message
> news:1AA68AB0-128E-44B2-8519-6357D7EBD465@.microsoft.com...
> > I'm trying to figure out how to create a custom series color in a bar
> chart,
> > and am unable to find documentation on it.
> >
> > I read a post here on trying the Choose() function in the fill color
> portion
> > of the series value, but my chart goes gray in the layout mode, and then
> in
> > the preview mode it just shows the default colors.
> >
> > Any documentation on this I can read?
>
>|||There might be multiple issues here:
* A chart is similar to a matrix. Therefore a "cell" (datapoint) in a chart
can actually contain multiple rows depending on the groupings applied. Using
Fields!description.Value will always return the first value if multiple rows
are present.
If series groupings are present in the chart, you have to use
=First(Fields!description.Value, "NameOfInnermostSeriesGrouping") to get the
correct datapoint value in your expression. You might also want to check
this thread:
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.sqlserver.reportingsvcs&mid=15f4e34b-345a-4876-8cbe-734b9e4dfa53&sloc=en-us
* Transparent is not a valid color. The only exceptions are currently the
chart area and the plot area fill colors (it's on the wishlist for
extensions in a future release).
Since transparent is not valid color, it gets ignored and the default color
(from the palette) applies. If you want to "hide" entire
datapoints/categories, you can filter them. If you have a solid plotarea
background color you could also assign the plotarea color to hide
datapoints.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Matt" <Matt@.discussions.microsoft.com> wrote in message
news:917930D0-5D0E-4231-A6BD-1B58602D4D9F@.microsoft.com...
> That makes sense,
> But still having an issue of what function to use in the fill color field.
> I have
> =IIf( Fields!descriptn.Value = "Self", "white","Transparent")
> But it seems to ingore it.
> "Robert Bruckner [MSFT]" wrote:
> > Keep in mind that expressions cannot be evaluated in design mode.
> > From the SP1 Readme about chart enhancements:
> >
http://download.microsoft.com/download/7/f/b/7fb1a251-13ad-404c-a034-10d79ddaa510/SP1Readme_EN.htm#_chart_enhancements
> > "If you use an expression for fill color, the chart elements will be
white
> > in Layout view, but will display properly when the report is run."
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no
rights.
> >
> >
> > "Matt" <Matt@.discussions.microsoft.com> wrote in message
> > news:1AA68AB0-128E-44B2-8519-6357D7EBD465@.microsoft.com...
> > > I'm trying to figure out how to create a custom series color in a bar
> > chart,
> > > and am unable to find documentation on it.
> > >
> > > I read a post here on trying the Choose() function in the fill color
> > portion
> > > of the series value, but my chart goes gray in the layout mode, and
then
> > in
> > > the preview mode it just shows the default colors.
> > >
> > > Any documentation on this I can read?
> >
> >
> >|||We create one particular line chart in which the number of lines will be
different based on what the user selects when printing the report. They graph
the performance of their portfolio to that of 1-5 different indices. So the
chart will have between 2 and 6 different lines on it.
In the data tab of the chart, we have one item listed under values, one
under category groups, and one under series groups.
Everything works great. Our problem is that when there are so many lines
that the chart uses a Green and LightGreen color for two of the lines, our
client can't tell those two colors apart and wants us to use a different
color than LightGreen.
We have tried to use the various suggestions seen in this and other blogs to
customize the color but it doesn't work.
Can anyone help us? I can provide more info if needed.
This is what we have tried under
Edit Value=>Appearance=>Series Style=>Fill=>Color=>Expression:
=Choose(Fields!uv_port_type.Value,"Red","Blue","Green","Yellow","Purple","Orange")
=CStr(Choose(Fields!uv_port_type.Value,"Red","Blue","Green","Yellow","Purple","Orange"))
= Choose(First(Fields!uv_port_type.Value,
"dsUnitValues"),"Red","Blue","Green","Yellow","Purple","Orange")
= CStr(Choose(First(Fields!uv_port_type.Value,
"dsUnitValues"),"Red","Blue","Green","Yellow","Purple","Orange"))
(We also tried "IIF" statements.)
Thank you!
Jen
"Robert Bruckner [MSFT]" wrote:
> There might be multiple issues here:
> * A chart is similar to a matrix. Therefore a "cell" (datapoint) in a chart
> can actually contain multiple rows depending on the groupings applied. Using
> Fields!description.Value will always return the first value if multiple rows
> are present.
> If series groupings are present in the chart, you have to use
> =First(Fields!description.Value, "NameOfInnermostSeriesGrouping") to get the
> correct datapoint value in your expression. You might also want to check
> this thread:
> http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.sqlserver.reportingsvcs&mid=15f4e34b-345a-4876-8cbe-734b9e4dfa53&sloc=en-us
> * Transparent is not a valid color. The only exceptions are currently the
> chart area and the plot area fill colors (it's on the wishlist for
> extensions in a future release).
> Since transparent is not valid color, it gets ignored and the default color
> (from the palette) applies. If you want to "hide" entire
> datapoints/categories, you can filter them. If you have a solid plotarea
> background color you could also assign the plotarea color to hide
> datapoints.
> --
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Matt" <Matt@.discussions.microsoft.com> wrote in message
> news:917930D0-5D0E-4231-A6BD-1B58602D4D9F@.microsoft.com...
> > That makes sense,
> >
> > But still having an issue of what function to use in the fill color field.
> >
> > I have
> >
> > =IIf( Fields!descriptn.Value = "Self", "white","Transparent")
> >
> > But it seems to ingore it.
> >
> > "Robert Bruckner [MSFT]" wrote:
> >
> > > Keep in mind that expressions cannot be evaluated in design mode.
> > > From the SP1 Readme about chart enhancements:
> > >
> http://download.microsoft.com/download/7/f/b/7fb1a251-13ad-404c-a034-10d79ddaa510/SP1Readme_EN.htm#_chart_enhancements
> > > "If you use an expression for fill color, the chart elements will be
> white
> > > in Layout view, but will display properly when the report is run."
> > >
> > > --
> > > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> > >
> > >
> > > "Matt" <Matt@.discussions.microsoft.com> wrote in message
> > > news:1AA68AB0-128E-44B2-8519-6357D7EBD465@.microsoft.com...
> > > > I'm trying to figure out how to create a custom series color in a bar
> > > chart,
> > > > and am unable to find documentation on it.
> > > >
> > > > I read a post here on trying the Choose() function in the fill color
> > > portion
> > > > of the series value, but my chart goes gray in the layout mode, and
> then
> > > in
> > > > the preview mode it just shows the default colors.
> > > >
> > > > Any documentation on this I can read?
> > >
> > >
> > >
>
>|||I found the following on SQLJunkies.. Seems to work:
--
Need a custom palette for your charts? Embed the function below into your
report, and set the Data > Values > Appearance > Series Style > Fill to the
custom function =Code.SetColor. Replace the nnnn's below with the hex codes
you need. See http://www.321webmaster.com/colorconverter.php for an RGB to
hex converter online. And hug the Reporting Services developers for adding
custom color functionality into SP1.
Function SetColor As String
Static ColorCode as Integer
ColorCode = ColorCode + 1: If ColorCode > 5 then ColorCode = 1
Select Case ColorCode
Case 1:
SetColor = "#00nnnn" ' Bluish
Case 2:
SetColor = "#78nnnn" ' Greenish
Case 3:
SetColor = "#E2nnnn" ' Reddish
Case 4:
SetColor = "#00nnnn" ' Navyish
Case 4:
SetColor = "#CCnnnn" ' Yellowish
Case 5:
SetColor = "#00nnnn" ' Light Blueish
Case Else:
SetColor = "#000000" ' Black (placeholder)
End Select
End Function
--
I have a where I need to show an average value in bar graph, but how many
values went into that average is also important. I pull back a percentage in
the query and then created a function that based on a percentage, returns a
color. Added =Code.FunctionName(pct) to the series fill and voila!
George
"Jen Rubin" wrote:
> We create one particular line chart in which the number of lines will be
> different based on what the user selects when printing the report. They graph
> the performance of their portfolio to that of 1-5 different indices. So the
> chart will have between 2 and 6 different lines on it.
> In the data tab of the chart, we have one item listed under values, one
> under category groups, and one under series groups.
> Everything works great. Our problem is that when there are so many lines
> that the chart uses a Green and LightGreen color for two of the lines, our
> client can't tell those two colors apart and wants us to use a different
> color than LightGreen.
> We have tried to use the various suggestions seen in this and other blogs to
> customize the color but it doesn't work.
> Can anyone help us? I can provide more info if needed.
> This is what we have tried under
> Edit Value=>Appearance=>Series Style=>Fill=>Color=>Expression:
> => Choose(Fields!uv_port_type.Value,"Red","Blue","Green","Yellow","Purple","Orange")
> => CStr(Choose(Fields!uv_port_type.Value,"Red","Blue","Green","Yellow","Purple","Orange"))
> = Choose(First(Fields!uv_port_type.Value,
> "dsUnitValues"),"Red","Blue","Green","Yellow","Purple","Orange")
> = CStr(Choose(First(Fields!uv_port_type.Value,
> "dsUnitValues"),"Red","Blue","Green","Yellow","Purple","Orange"))
> (We also tried "IIF" statements.)
> Thank you!
> Jen
>
> "Robert Bruckner [MSFT]" wrote:
> > There might be multiple issues here:
> > * A chart is similar to a matrix. Therefore a "cell" (datapoint) in a chart
> > can actually contain multiple rows depending on the groupings applied. Using
> > Fields!description.Value will always return the first value if multiple rows
> > are present.
> > If series groupings are present in the chart, you have to use
> > =First(Fields!description.Value, "NameOfInnermostSeriesGrouping") to get the
> > correct datapoint value in your expression. You might also want to check
> > this thread:
> > http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.sqlserver.reportingsvcs&mid=15f4e34b-345a-4876-8cbe-734b9e4dfa53&sloc=en-us
> >
> > * Transparent is not a valid color. The only exceptions are currently the
> > chart area and the plot area fill colors (it's on the wishlist for
> > extensions in a future release).
> > Since transparent is not valid color, it gets ignored and the default color
> > (from the palette) applies. If you want to "hide" entire
> > datapoints/categories, you can filter them. If you have a solid plotarea
> > background color you could also assign the plotarea color to hide
> > datapoints.
> >
> > --
> > This posting is provided "AS IS" with no warranties, and confers no rights.
> >
> >
> > "Matt" <Matt@.discussions.microsoft.com> wrote in message
> > news:917930D0-5D0E-4231-A6BD-1B58602D4D9F@.microsoft.com...
> > > That makes sense,
> > >
> > > But still having an issue of what function to use in the fill color field.
> > >
> > > I have
> > >
> > > =IIf( Fields!descriptn.Value = "Self", "white","Transparent")
> > >
> > > But it seems to ingore it.
> > >
> > > "Robert Bruckner [MSFT]" wrote:
> > >
> > > > Keep in mind that expressions cannot be evaluated in design mode.
> > > > From the SP1 Readme about chart enhancements:
> > > >
> > http://download.microsoft.com/download/7/f/b/7fb1a251-13ad-404c-a034-10d79ddaa510/SP1Readme_EN.htm#_chart_enhancements
> > > > "If you use an expression for fill color, the chart elements will be
> > white
> > > > in Layout view, but will display properly when the report is run."
> > > >
> > > > --
> > > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > > >
> > > >
> > > > "Matt" <Matt@.discussions.microsoft.com> wrote in message
> > > > news:1AA68AB0-128E-44B2-8519-6357D7EBD465@.microsoft.com...
> > > > > I'm trying to figure out how to create a custom series color in a bar
> > > > chart,
> > > > > and am unable to find documentation on it.
> > > > >
> > > > > I read a post here on trying the Choose() function in the fill color
> > > > portion
> > > > > of the series value, but my chart goes gray in the layout mode, and
> > then
> > > > in
> > > > > the preview mode it just shows the default colors.
> > > > >
> > > > > Any documentation on this I can read?
> > > >
> > > >
> > > >
> >
> >
> >
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment