BIRT Chart color manipulation [message #1008287] |
Mon, 11 February 2013 19:03 |
A R Messages: 104 Registered: April 2012 |
Senior Member |
|
|
My graph is binded to one dataset and I am using the following script in the on render, after data set filled to fix the axis details :
====================================================================================
importPackage( Packages.java.util );
importPackage( Packages.org.eclipse.birt.chart.model.type.impl );
importPackage(Packages.org.eclipse.birt.chart.model.component.impl);
importPackage(Packages.org.eclipse.birt.chart.model.attribute);
function afterDataSetFilled(series, dataSet, icsc)
{
if( series.getClass() == BarSeriesImpl ){
var list = dataSet.getValues();
var X= parseInt(icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("X"));
var Y= parseInt(icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("Y"));
var Z= parseInt(icsc.getExternalContext().getScriptable().getPersistentGlobalVariable("Z"));
var narray1 = new ArrayList( );
narray1.add(X);
narray1.add(Y);
narray1.add(Z);
dataSet.setValues(narray1);
}else{
var catArray = new ArrayList();
catArray.add("Naming Convention ");
catArray.add("Basic Profile ");
catArray.add("Non-Stanbdard ");
dataSet.setValues(catArray);
}
}
====================================================================================
If I want to use the different colors to each bar in the graph how can I improve the script.
Thanks
AR
[Updated on: Mon, 11 February 2013 19:10] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02523 seconds