CategoricalColorFrame.getColor(val)

Returns the color assigned to the specified value.

Parameter

val a 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);

var robColor = Chart1.bindingInfo.colorFrame.getColor("Robert")

Chart1.bindingInfo.colorFrame.setColor("Sue",robColor);

 

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));

var NJcolor = frame.getColor('NJ');

frame.setColor('NY',NJcolor);

elem.setColorFrame(frame);

graph.addElement(elem);

 

See Also

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

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