Change line color via script in a chart
I have a line chart that pulls data from a Trend Chart Query in Clear Quest. I would like to set the color of the lines via the script. Belos is the script I have - I am able to set the color of the datapoint and the legend but the line picks the default series colors. Please Help!
function beforeDrawLegendItem(lerh, bounds, icsc)
{
val = lerh.getLabel().getCaption().getValue();
fill = lerh.getFill();
if (val == "Open")
fill.set(255,0,0); // color red
else if(val == "Pending Verification")
fill.set(0,0,255); //color blue
else if (val == "Rejected-Closed")
fill.set(0,255,0); // color yellow
else if(val == "Fixed-Closed")
fill.set(0,0,0); //color black
}
function beforeDrawDataPoint(dph, fill, icsc)
{
if (dph.getSeriesValue() == "Open")
fill.set(255,0,0); // color red
else if(dph.getSeriesValue() == "Pending Verification")
fill.set(0,0,255); //color blue
else if(dph.getSeriesValue() == "Rejected-Closed")
fill.set(0,255,0); //color yellow
else if(dph.getSeriesValue() == "Fixed-Closed")
fill.set(0,0,0); //color black
}
function beforeDrawSeries(series, isr, icsc)
{
importPackage(Packages.org.eclipse.birt.chart.model.component.impl);
importPackage(Packages.org.eclipse.birt.chart.model.attribute);
var seriesID = series.getSeriesIdentifier();
if (seriesID == "Open")
{
series.getLineAttributes().getColor().set(255,0,0);
}
if (seriesID == "Pending Verification")
{
series.getLineAttributes().getColor().set(0,0,255);
}
if (seriesID == "Rejected-Closed")
{
series.getLineAttributes().getColor().set(0,255,0);
}
if (seriesID == "Fixed-Closed")
{
series.getLineAttributes().getColor().set(0,0,0);
}
}