Este diagrama foi gerado pelo
<SCRIPT Language="JavaScript">
document.open();
var D=new Diagram();
D.SetFrame(80, 160, 520, 360);
D.SetBorder(-1, 13, 0, 1000);
D.SetText("","", "Website Hits 2001");
D.XScale=0;
D.Draw("#FFFF80", "#004080", false);
var i, j, y;
Month=new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
for (i=0; i<12; i++)
{ y=500+Math.random()*400;
j=D.ScreenX(i+0.5);
if (i%2==0) new Bar(j-15, D.ScreenY(y), j+15, D.ScreenY(0), "#0000FF", Month[i], "#FFFFFF", "Hits per month");
else new Bar(j-15, D.ScreenY(y), j+15, D.ScreenY(0), "#FF0000", Month[i], "#000000", "Hits per month");
}
document.close();
</SCRIPT>
Você pode usar os seguintes métodos:
- var B = new Bar(theLeft, theTop, theRight, theBottom, theDrawColor, theText, theTextColor
[, theTooltipText[, theOnClickAction[, theOnMouseoverAction[, theOnMouseoutAction]]]])
//Constructor e desenho, if theText="", then min_height=1 else min_height=12
//se quiser usar B.SetText() depois, então você deve inicializar com um texto<>""
- B.SetColor(theColor) //Cor
- B.SetVisibility(isVisible) //Mostrar ou esconder
- B.SetText(theText) //Texto ou imagem
- B.SetTitle(theTitle) //TooltipText
- B.MoveTo(theLeft, theTop) //Mover
- B.ResizeTo(theLeft, theTop, theWidth, theHeight) //Aumentar ou diminuir
- B.Delete() //Apagar o objeto DIV do B do documento
- delete B //Destructor
Antes de desenhar, você pode mudar o estilo do texto:
_BFont=theFont;
_BFont é uma variável global, que seja válida para todos os objetos Bar e Box. O valor default é
_BFont="font-family:Verdana;font-weight:bold;font-size:10pt;line-height:13pt;".