CategoricalColorFrame.setColor(val,color)

Assigns a color to the specified value.

Parameter

val data value

color java.awt.Color to represent data value

Note: Report script that modifies 'bindingInfo' should be placed in the onLoad handler.

Example (Report)

Bind a bar-type chart to the sample 'All Sales' query, with 'Company' (top 5) on the X-axis, and Sum(Total) on the Y-axis. Add the following script in the onLoad handler.

Chart1.bindingInfo.setColorField("Employee",Chart.STRING);

Chart1.bindingInfo.colorFrame = new CategoricalColorFrame;

Chart1.bindingInfo.colorFrame.setColor("Robert",java.awt.Color.lightGray);

Chart1.bindingInfo.colorFrame.setColor("Sue",java.awt.Color(0x222222));

 

Note: Script that modifies 'graph' should be placed at the element level. See Adding Element-Level Script in Report Scripting and Adding Component Script in Dashboard Scripting for more information.

Example (Report or Viewsheet)

dataset = [["State","Quantity"], ["NJ",200], ["NY",300]];

graph = new EGraph();

var elem = new IntervalElement("State", "Quantity")

frame = new CategoricalColorFrame();

frame.setField("State");

frame.setColor('NJ',java.awt.Color(0xff0000));

frame.setColor('NY',java.awt.Color(0xff00ff));

elem.setColorFrame(frame)

graph.addElement(elem);

 

See Also

DataSet, to use a Data Block or query as the dataset source.

<< CategoricalColorFrame.init(val[,color]) © 1996-2013 InetSoft Technology Corporation (v11.4) CR.7.13 SizeFrame >>