RectForm.setTopLeftPoint(value)
Specifies the pixel location (integer values) or proportional location (fractional values) defining the top left corner of the rectangle. (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
Example (Report)
importPackage(inetsoft.graph.aesthetic);
Graph1.bindingInfo.setShapeField("Employee",Chart.STRING);
Graph1.bindingInfo.lineFrame = new CategoricalLineFrame;
Graph1.bindingInfo.lineFrame.setLine('Robert',
GLine.LARGE_DASH);
Graph1.bindingInfo.lineFrame.setLine('Eric',
GLine.LARGE_DASH);
Graph1.bindingInfo.lineFrame.setLine('Sue',GLine.DOT_LINE);
Graph1.bindingInfo.lineFrame.setLine('Annie',
GLine.DOT_LINE);
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"], ["NJ", 200], ["NY", 300]];
dataset = new DefaultDataSet(arr);
graph = new EGraph();
var elem = new IntervalElement("State", "Quantity");
var rect1 = new RectForm();
var rect2 = new RectForm();
// Set rect1 points in pixels:
rect1.setTopLeftPoint(new java.awt.Point(100, 100));
rect1.setBottomRightPoint(new java.awt.Point(150, 50));
rect1.setColor(java.awt.Color(0xff0000));
// Set rect2 points proportionally:
rect2.setTopLeftPoint(new java.awt.geom.Point2D.Double(.5,.8));
rect2.setBottomRightPoint(new java.awt.geom.Point2D.Double(.8,.5));
rect2.setColor(java.awt.Color(0xff00ff));
graph.addForm(rect1);
graph.addForm(rect2);
graph.addElement(elem);