This diagram was generated by
<SCRIPT Language="JavaScript">
document.open();
var D=new Diagram();
D.SetFrame(80, 160, 520, 360);
D.SetBorder(Date.UTC(2000,11,15,0,0,0), Date.UTC(2001,11,15,0,0,0), 0, 1000);
D.SetText("","", "Website Hits 2001");
D.XScale=4;
D.Draw("", "#004080", false);
var i, j, y, y0=D.ScreenY(0);
for (i=0; i<12; i++)
{ y=D.ScreenY(500+Math.random()*400);
j=D.ScreenX(Date.UTC(2001,i,1,0,0,0));
if (i%2==0) new Box(j-12, y, j+12, y0, "#0000FF", "v_blue.gif", "#FFFFFF", 1, "#000000");
else new Box(j-12, y, j+12, y0, "#FF0000", "v_red.gif", "#000000", 1, "#000000");
}
document.close();
</SCRIPT>
You can use the following methods:
- var B = new Box(theLeft, theTop, theRight, theBottom, theDrawColor, theText, theTextColor
[, theBorderWidth[, theBorderColor[, theTooltipText[, theOnClickAction[,
theOnMouseoverAction[, theOnMouseoutAction]]]]]])
//Constructor and Display, if theText="" then min_height=1 else min_height=12
//if you want to use B.SetText() later, then you must initialize with a Text<>""
- B.SetColor(theColor) //Color
- B.SetVisibility(isVisible) //Show or Hide
- B.SetText(theText) //Text or Image
- B.SetTitle(theTitle) //TooltipText
- B.MoveTo(theLeft, theTop) //Move
- B.ResizeTo(theLeft, theTop, theWidth, theHeight) //Resize
- B.Delete() //Delete DIV object of B from the document
- delete B //Destructor
Before drawing, you can change the text style:
_BFont=theFont;
_BFont is a global variable, which is valid for all Bar and Box objects.
The default setting is
_BFont="font-family:Verdana;font-weight:bold;font-size:10pt;line-height:13pt;".