CategoricalColorFrame.setColor(val,color)
Assigns a color to the specified value.
Parameter
val data value
color java.awt.Color to represent data value
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.
importPackage(inetsoft.graph.aesthetic);
Graph1.bindingInfo.setColorField("Employee",Chart.STRING);
Graph1.bindingInfo.colorFrame = new CategoricalColorFrame;
Graph1.bindingInfo.colorFrame.setColor("Robert",
java.awt.Color.lightGray);
Graph1.bindingInfo.colorFrame.setColor("Sue",
java.awt.Color(0x222222));
Example (Viewsheet or Report)
importPackage(inetsoft.graph)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.data)
var arr = [["State","Quantity"], ["NJ",200], ["NY",300]];
dataset = new DefaultDataSet(arr);
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);
|
“Flexible product with great training and support. The product has been very useful for quickly creating dashboards and data views. Support and training has always been available to us and quick to respond.
- George R, Information Technology Specialist at Sonepar USA
|