JavaScript Diagram Builder - The Arrow object
|
The Arrow object is used to display an arrow on the screen, especially to draw it in a diagram area. It is
possible to hide, move and delete an arrow after it has been drawn. The Arrow object has a quite large
invisible border, so that it can interfere with the TooltipText and onClick event of neighbouring objects.
Because of that you should always draw the Arrow objects first, before drawing any neighbouring Bar or Box objects.
|
This arrows were generated by
<SCRIPT Language="JavaScript">
document.open();
var D=new Diagram();
D.SetFrame(60, 140, 300, 380);
D.SetBorder(-1, 1, -1, 1);
var i, x, y;
for (i=0; i<11; i++)
{ x=Math.sin((i+0.5)*2*Math.PI/11);
y=Math.cos((i+0.5)*2*Math.PI/11);
new Arrow(D.ScreenX(x/3), D.ScreenY(y/3), D.ScreenX(x), D.ScreenY(y), "#0000ff", i%5+1);
}
document.close();
</SCRIPT>
You can use the following methods:
- var A = new Arrow(theX0, theY0, theX1, theY1, theColor[, theSize[, theTooltipText[,
theOnClickAction[, theOnMouseoverAction[, theOnMouseoutAction]]]]])
//Constructor and Display
- A.SetColor(theColor) //Color
- A.SetVisibility(isVisible) //Show or Hide
- A.SetTitle(theTitle) //TooltipText
- A.MoveTo(theLeft, theTop) //Move
- A.ResizeTo(theX0, theY0, theX1, theY1) //Resize
- A.Delete() //Delete DIV object of A from the document
- delete A //Destructor