ThermoShapeFrame
The ThermoShapeFrame object contains the shape styles for two-dimensional “thermometer” elements. To create a ThermoShapeFrame object, call the ThermoShapeFrame constructor.
var range = new ThermoShapeFrame("Height", "Weight");
You can pass a pair of field names (e.g., 'Height', 'Weight') to the constructor, or specify this later using the inherited MultiShapeFrame.setFields(arr) property. The dimensions are specified in the order [level, width].
Example (Report or Viewsheet)
Bind a point-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)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.data)
var arr = [["State", "Quantity","Height","Weight"],
["NJ", 200,50,1], ["NY", 300,30,4]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var frame = new ThermoShapeFrame();
var elem = new PointElement("State", "Quantity");
var hscale = new LinearScale()
var wscale = new LinearScale()
hscale.setMin(0);
hscale.setMax(100);
wscale.setMin(0);
wscale.setMax(5);
frame.setFields(["Height", "Weight"]);
frame.setScales([hscale, wscale]);
elem.setShapeFrame(frame);
graph.addElement(elem);
StarShapeFrame
The StarShapeFrame object contains the shape styles for multi-dimensional “star” (closed line) elements. To create a StarShapeFrame object, call the StarShapeFrame constructor.
var range = new StarShapeFrame("m1","m2","m3");
You can pass a set of field names (e.g., 'm1', 'm2', 'm3') to the constructor, or specify this later using the inherited MultiShapeFrame.setFields(arr) property.
Example (Report or Viewsheet)
importPackage(inetsoft.graph)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.data)
var arr = [["State", "Quantity","m1","m2","m3"],
["NJ", 200,5,1,3], ["NY", 300,3,4,4]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var frame = new StarShapeFrame();
var elem = new PointElement("State", "Quantity");
frame.setFields(["m1","m2","m3"]);
elem.setShapeFrame(frame);
graph.addElement(elem);