GradientColorFrame.setFromColor(value)

Specifies the starting color (for lowest value) of the gradient.

Value (Property Syntax)

java.awt.Color          e.g., java.awt.Color.BLUE

number (hex)            e.g., 0xFF0000

string (color name)     e.g., 'red'

array [r,g,b]           e.g., [255,0,0]

JSON {r:#,g:#,b:#}      e.g., {r:255,g:0,b:0}

Value (Function Syntax)

value a java.awt.Color object

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("Total",Chart.NUMBER);

Chart1.bindingInfo.colorFrame = new GradientColorFrame;

Chart1.bindingInfo.colorFrame.fromColor = 0x0000FF;

Chart1.bindingInfo.colorFrame.toColor = 0xFF00FF;

 

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],["PA",50],["CT",100]];

graph = new EGraph();

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

var frame = new GradientColorFrame();

frame.setFromColor(java.awt.Color(0x000000));

frame.setToColor(java.awt.Color(0xff0000));

frame.setField("Quantity");

elem.setColorFrame(frame);

graph.addElement(elem);

 

See Also

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

<< CR.7.8 GradientColorFrame © 1996-2013 InetSoft Technology Corporation (v11.4) GradientColorFrame.setToColor(value) >>