|
|
|
|
|
Re: Fix color for series in bar chart [message #1033572 is a reply to message #1027046] |
Thu, 04 April 2013 07:38   |
Eclipse User |
|
|
|
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 516 times)
[Updated on: Thu, 04 April 2013 07:48] by Moderator
|
|
|
Re: Fix color for series in bar chart [message #1033661 is a reply to message #1033572] |
Thu, 04 April 2013 09:43  |
Eclipse User |
|
|
|
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.04260 seconds