Change chart series color via script in birt 2.3.1 [message #548482] |
Thu, 22 July 2010 06:30 |
No real name Messages: 2 Registered: July 2010 |
Junior Member |
|
|
Hi everyone,
I have a line chart and I have to check the values of some parameters to define the colours of each line, so I need to use the script. I have tried this:
function beforeDrawSeries(series, isr, icsc)
{
importPackage(Packages.org.eclipse.birt.chart.model.componen t.impl);
importPackage(Packages.org.eclipse.birt.chart.model.attribut e);
var seriesID = series.getSeriesIdentifier();
if (seriesID == "series 1")
{
series.getLineAttributes().getColor().set(255,255,0);
}
But I'm using Birt 2.3.1, and I get the error that the method getLineAttributes() is not defined, because in this version of Birt the package org.eclipse.birt.chart does not exist.
I also have unchecked the option "Use Series Palette as Line Color" in each series in the Edit Chart window.
I have tried the following as well:
function beforeDrawSeries(series, isr, icsc)
{
importPackage(Packages.org.eclipse.birt.chart.model.componen t.impl);
importPackage(Packages.org.eclipse.birt.chart.model.attribut e);
var seriesID = series.getSeriesIdentifier();
var seriesId = series.getSeriesIdentifier();
if (seriesId == "series 1"){
icsc.getChartInstance().getPlot().getOutline().getColor().se t(255,255,0);
}
because icsc.getChartInstance().getPlot().getOutline() returns a LineAttribute type Object, but although I don't get any error, I don't get the expected result (I see every line in black).
Is there any way to do this with Birt 2.3.1?
Thank you very much in advance!!
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02748 seconds