|
Re: Fix color for series in bar chart [message #1027391 is a reply to message #1027046] |
Tue, 26 March 2013 23:16   |
|
You can set the color using a script similar to:
function beforeDrawDataPoint(dph, fill, icsc)
{
val = dph.getBaseDisplayValue();
if (val == "within specification"){
fill.set(255, 0, 0);
}
}
You should be able to change the order by putting in a custom expression on the sort expression for the optional grouping category.
|
|
|
|
Re: Fix color for series in bar chart [message #1028071 is a reply to message #1027951] |
Wed, 27 March 2013 20:02   |
|
Daniel
For flash you will need to do something like:
if( fcdph.getDataPointHints().getBaseValue() == "S12_3148" ){
fill.setRed(255);
fill.setBlue(0);
fill.setGreen(0);
}
BTW have you seen this post?
http://birtworld.blogspot.com/2010/08/birt-flash-and-gadget-scripting.html
|
|
|
|
Re: Fix color for series in bar chart [message #1033572 is a reply to message #1027046] |
Thu, 04 April 2013 11:38   |
Daniel W Messages: 8 Registered: March 2013 |
Junior Member |
|
|
Ok,
just tried it with a normal chart.
I had to change things a little, because I want to change the color depending on the series:
That works for me:
function beforeDrawDataPoint( dph, fill, icsc )
{
val = dph.getBaseDisplayValue();
test = dph.getBaseValue();
test2 = dph.getSeriesDisplayValue();
if (test2 == 'within specification'){
fill.set(255,255,0);
}
else {
fill.set(255,0,0);
}
}
ps: I have one more issue. The legend of the series still shows the old color. Is there a possible way to change that one also?
Attachment: Snap30.jpg
(Size: 17.18KB, Downloaded 473 times)
[Updated on: Thu, 04 April 2013 11:48] Report message to a moderator
|
|
|
Re: Fix color for series in bar chart [message #1033661 is a reply to message #1033572] |
Thu, 04 April 2013 13:43  |
Daniel W Messages: 8 Registered: March 2013 |
Junior Member |
|
|
just solved it:
function beforeDrawLegendItem( lerh, bounds, icsc )
{
var label = lerh.getLabel().getCaption().getValue();
if( label == "within specification")
lerh.getFill().set(0,158,227);
else if (label == 'within specification after adj.')
lerh.getFill().set(247,234,72);
else if (label == 'out of specification')
lerh.getFill().set(227,41,9);
else if (label == 'unknown')
lerh.getFill().set(255,0,128);
}
|
|
|
Powered by
FUDForum. Page generated in 0.02308 seconds