Hello BIRT community,<br />
<br />
I want to set chart color on runtime in a rptdesign vie script. What I found from this forum and other pages was this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
/**
* Called before drawing each datapoint graphical representation or marker.
*
*
@param dph
* DataPointHints
*
@param fill
* Fill
*
@param icsc
* IChartScriptContext
*/
function beforeDrawDataPoint( dph, fill, icsc )
{
importPackage( Packages.java.io );
importPackage( Packages.org.eclipse.birt.chart.model.attribute.impl );
var mycolor = ColorDefinitionImpl.GREEN();
r = mycolor.getRed();
g = mycolor.getGreen();
b = mycolor.getBlue();
fill.set(r, g,

;
}</pre>
<br />
But this code works when the chart has simple color and not gradient (two colors). <br />
Using this for 2 colors I got exception in the line where "fill.set( r, g, b );" is invoked.<br />
<br />
What could the right solution be?<br />
<br />
I have tried:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
fill.setStart(r, g, b );
fill.setEnd(r, g, b );
fill.start(r, g, b );
fill.end(r, g, b );</pre>
and still got the exception that the functions coudn't be found.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>Cannot find function start in object org.eclipse.birt.chart.model.attribute.impl.GradientImpl@1d01b3c (type: <unset>) (direction: <unset>, cyclic: <unset>, transparency: <unset>). at line 23 of chart script</pre>
<br />
Next I will check the API. maybe there ist the solution about this one.<br />
<br />
<br />
Thanks in advance for any suggestion and hint.