Mapping Between Axis Values

AxisSpec.setTextFrame(frame)

Specifies a mapping between axis values and replacement text.

Parameter
 frame
 a TextFrame object
Example (Report or Viewsheet)
 importPackage(inetsoft.graph)
 importPackage(inetsoft.graph.data)
 importPackage(inetsoft.graph.element)
 importPackage(inetsoft.graph.aesthetic)
 importPackage(inetsoft.graph.scale)
 importPackage(inetsoft.graph.coord)
 importPackage(inetsoft.graph.guide.form)
 
 var arr = [["State","Quantity"],["NJ",20000],["NY",30000]];
 dataset = new DefaultDataSet(arr);
 graph = new EGraph();
 var elem = new IntervalElement("State", "Quantity");
 var cscale = new CategoricalScale("State");
 var tframe = new DefaultTextFrame();
 tframe.setText('NJ','New Jersey');
 tframe.setText('NY','New York');
 var aspec = new AxisSpec();
 aspec.setTextFrame(tframe);
 cscale.setAxisSpec(aspec);
 graph.setScale("State", cscale);
 graph.addElement(elem);

AxisSpec.setTextSpec(spec)

Specifies the display of axis text.

Parameter
 spec a TextSpec object
Example (Report or Viewsheet)
 importPackage(inetsoft.graph)
 importPackage(inetsoft.graph.data)
 importPackage(inetsoft.graph.element)
 importPackage(inetsoft.graph.aesthetic)
 importPackage(inetsoft.graph.scale)
 importPackage(inetsoft.graph.coord)
 importPackage(inetsoft.graph.guide.form)
 
 var arr = [["State", "Quantity"], ["NJ", 200], ["NY", 300]];
 dataset = new DefaultDataSet(arr);
 graph = new EGraph();
 var elem = new IntervalElement("State", "Quantity");
 var qscale = new LinearScale("Quantity");
 var aspec = new AxisSpec();
 var textspec = new TextSpec();
 textspec.setColor(java.awt.Color(0xff0000));
 aspec.setTextSpec(textspec);
 qscale.setAxisSpec(aspec);
 graph.setScale("Quantity", qscale);
 graph.addElement(elem);

AxisSpec.setTickVisible(boolean)

Specifies whether the axis tick marks are visible or hidden.

Parameter
 Boolean
 true if visible
 false if not visible
Example (Report or Viewsheet)
 importPackage(inetsoft.graph)
 importPackage(inetsoft.graph.data)
 importPackage(inetsoft.graph.element)
 importPackage(inetsoft.graph.aesthetic)
 importPackage(inetsoft.graph.scale)
 importPackage(inetsoft.graph.coord)
 importPackage(inetsoft.graph.guide.form)
 
 var arr = [["State", "Quantity"], ["NJ", 200], ["NY", 300]];
 dataset = new DefaultDataSet(arr);
 graph = new EGraph();
 var elem = new IntervalElement("State", "Quantity");
 var qscale = new LinearScale("Quantity");
 var aspec = new AxisSpec();
 aspec.setTickVisible(false);
 qscale.setAxisSpec(aspec);
 graph.setScale("Quantity", qscale);
 graph.addElement(elem);

GraphElement

The GraphElement object contains the visual elements that represent data. For example, PointElement is a GraphElement that represents data tuples as points.

GraphElement.addDim(field)

Add a dimension to a GraphElement object. A dimension is plotted on the X-axis, or on the outer coordinates of nested coordinates.

Parameter
 field
 String containing name of dimension
Example (Report or Viewsheet)
 importPackage(inetsoft.graph)
 importPackage(inetsoft.graph.data)
 importPackage(inetsoft.graph.element)
 importPackage(inetsoft.graph.aesthetic)
 importPackage(inetsoft.graph.scale)
 importPackage(inetsoft.graph.coord)
 importPackage(inetsoft.graph.guide.form)
 
 var arr = [["State", "City", "Quantity"],
            ["NJ","Edison",2500], ["NJ","Piscataway",3000],
            ["NY","NY City",5000],["NY","Yonkers",450]];
 dataset = new DefaultDataSet(arr);
 graph = new EGraph();
 var elem = new IntervalElement("State","Quantity");
 elem.addDim("City");
 graph.addElement(elem);
Previous: Axis Grid