Y Series Grouping and colors [message #362817] |
Tue, 27 May 2008 09:58 |
Anders Vegh Messages: 507 Registered: July 2009 |
Senior Member |
|
|
Hi,
I have created a bar chart where I put a "verdict" column from my database
as an "Optional Y Series Grouping". I have noticed that it is possible to
define that the first value will get a specific color, say green, the
second will get red and so forth.
My verdict column can cotain one of three values "passed", "failed" and
"not tested". I would like to link these values to specific colors to make
sure that "passed" always is green, "failed" always is red and "not
tested" is white.
Now I have the colors green, white, red in that order in my series palett
and then I have group sorting = descending on my verdict column, so it
works when all verdicts are present. But I have a report parameter that
offers a possibility to only show "failed" results and these bars will
then be green. I would like them to be red.
Any suggestions on how to link a color to a specific db-value?
Thanks in advance,
Anders
|
|
|
Re: Y Series Grouping and colors [message #362833 is a reply to message #362817] |
Tue, 27 May 2008 16:14 |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Anders,
Can you try adding a script to the chart like:
function beforeDrawDataPoint(dph, fill, icsc)
{
importPackage( Packages.java.io );
importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
if( dph.getBaseValue() == "Pass" ){
var mycolor = ColorDefinitionImpl.GREEN();
r = mycolor.getRed();
g = mycolor.getGreen();
b = mycolor.getBlue();
fill.set(r, g, b);
}
}
Jason
Anders Vegh wrote:
> Hi,
>
> I have created a bar chart where I put a "verdict" column from my
> database as an "Optional Y Series Grouping". I have noticed that it is
> possible to define that the first value will get a specific color, say
> green, the second will get red and so forth.
>
> My verdict column can cotain one of three values "passed", "failed" and
> "not tested". I would like to link these values to specific colors to
> make sure that "passed" always is green, "failed" always is red and "not
> tested" is white.
> Now I have the colors green, white, red in that order in my series
> palett and then I have group sorting = descending on my verdict column,
> so it works when all verdicts are present. But I have a report parameter
> that offers a possibility to only show "failed" results and these bars
> will then be green. I would like them to be red.
>
> Any suggestions on how to link a color to a specific db-value?
>
> Thanks in advance,
> Anders
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03245 seconds