JavaScript Diagram Builder - The Area object

The Area object is used to display an area chart into the diagram. You can also hide, move and delete it after it has been drawn. In order to draw the area object you need the images o_rrggbb.gif, d_rrggbb.gif, p_rrggbb.gif, q_rrggbb.gif and b_rrggbb.gif, which must be in the same directory. Red, blue and black images are already available. If you want to use other colors, you must first generate the required images.
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), -300, 1100);
D.SetText("","", "profit/loss per day during the last year");
D.XScale=4;
D.YScale=" $";
D.Draw("#FFFFCC", "#000000", false);
var i, t0, t1, P0, P1, base=D.ScreenY(0);
t1=D.ScreenX(Date.UTC(2000,11,15,0,0,0));
P1=0;
for (i=0; i<12; i++)
{ t0=t1; P0=P1;
  t1=D.ScreenX(Date.UTC(2001,i,15,0,0,0));
  P1+=(i/5-Math.random())*100;
  new Area(t0, D.ScreenY(P0), t1, D.ScreenY(P1), "ff0000", base, "profit/loss per day");
}
document.close();
</SCRIPT>

You can use the following methods:

« The Line object The Arrow object »