Home
Analytics
gant chart modifying color in groups
unknown
Hi,
In the attached exemple, I would like to put a different color on the two grouping element of my chart describe in "status2" computed column :
red for "decline"
green for "Shipped"
I try by scripting (because I want to force the color for these values) but I cant find the way to get the value of status2 column.
Any idea ?
thanks in advance
Vincent
Find more posts tagged with
Comments
mwilliams
Try this script, instead:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeDrawDataPoint( dph, fill, icsc )
{
if (dph.getSeriesDisplayValue() == "Shipped"){
fill.set(0,192,0);
}
else{
fill.set(255,0,0);
}
}
function beforeDrawLegendItem( lerh, bounds, icsc )
{
if (lerh.getLabel().getCaption().getValue() == "Shipped"){
lerh.getFill().set(0,192,0);
}
else{
lerh.getFill().set(255,0,0);
}
}
</pre>
Migrateduser
nickel !
Absolutely perfect, thanks a lot Michael !
Regards
Migrateduser
Hi<br />
<br />
For the same example, is it possible to define a different start marker for each value in the series like :<br />
if getValue() is "shipped" : start marker is triangle<br />
else : start marker is square<br />
<br />
I have another question :<br />
if I define a marker range :<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function beforeDrawMarkerRange(axis, markerRange, icsc)
{
importPackage( Packages.org.eclipse.birt.chart.model.data.impl );
markerRange.setEndValue(DateTimeDataElementImpl.create(new java.lang.Long(BirtDateTime.addDay(BirtDateTime.today(),5).getTime())))
markerRange.setStartValue(DateTimeDataElementImpl.create(new java.lang.Long(BirtDateTime.today().getTime())))
markerRange.getFill().set(0,0,0);
}
</pre>
with markerRange.getFill().set(0,0,0), i will change the color but I don't find how to change the color of the marker border end eventually the border width end type (if possible....)<br />
<br />
most largelly, for a scipt newbie like me... where can I find all the functions and possibility for each part like : markerRange, legend...<br />
<br />
Best regards