GraphForm.setMeasure(col)
Specifies the measure for which the form should be displayed. If the chart contains a measure of this name, the form object is displayed. Otherwise it is not displayed. This is useful for FacetCoord charts, when the form should be displayed only for the chart that represents a particular measure.
Type
col
name of a column (String)
You can pass a field name (e.g., 'Quantity') to the constructor, or specify this later using the inherited VisualFrame.setField(field) property. To stylize or reposition text created using a DefaultTextFrame, use the GraphElement.setTextSpec(spec) and GraphElement.setLabelPlacement(value) options.
Example (Report or Viewsheet)
importPackage(inetsoft.graph)
importPackage(inetsoft.graph.element)
importPackage(inetsoft.graph.scale)
importPackage(inetsoft.graph.aesthetic)
importPackage(inetsoft.graph.data)
importPackage(inetsoft.graph.coord)
importPackage(inetsoft.graph.guide.form)
var arr = [["State", "Quantity", "Sales"],
["NJ", 200, 800],
["NY", 300, 600]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
var elem2 = new IntervalElement("State", "Sales");
var form = new LabelForm();
form.setValues(['NJ',200]);
form.setLabel("NJ Sales");
form.setAlignmentX(GraphConstants.CENTER_ALIGNMENT);
form.setMeasure("Sales");
graph.addForm(form);
var scale = new CategoricalScale("State");
var qscale = new LinearScale("Quantity");
var sscale = new LinearScale("Sales");
var qcoord = new RectCoord(scale, qscale);
var scoord = new RectCoord(scale, sscale);
var facet = new FacetCoord();
facet.setInnerCoordinates([qcoord, scoord]);
graph.setCoordinate(facet);
graph.addElement(elem);
graph.addElement(elem2);