LegendSpec.setPosition(value)
Specifies the position of the legend's bottom-left corner (in pixels or proportion) for cases when “in place” layout is used. (Positive values specify distance from left/bottom. Negative values specify distance from right/top.)
Type
value a subclass of java.awt.geom.Point2D
e.g.,
java.awt.Point for pixels
java.awt.geom.Point2D.Double for proportion
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]];
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
var frame = new CategoricalColorFrame();
frame.setField("State");
var spec = new LegendSpec();
spec.setPosition(java.awt.Point(50,245)); // in pixels
frame.setLegendSpec(spec);
elem.setColorFrame(frame);
graph.setLegendLayout(GraphConstants.IN_PLACE);
graph.addElement(elem);

See Also
DataSet, to use a Data Block or query as the dataset source.
EGraph.setLegendLayout(value), to place the legend in a predefined location.
| << LegendSpec.setPartial(boolean) | © 1996-2013 InetSoft Technology Corporation (v11.4) | LegendSpec.setPreferredSize(value) >> |