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">;
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.YScale=" $";
D.Draw("#FFFFCC", "#000000", false);
var i, t0, t1, P0, P1, base=D.ScreenY(0);
for (i=0; i<12; i++)
{ t0=t1; P0=P1;
  new Area(t0, D.ScreenY(P0), t1, D.ScreenY(P1), "ff0000", base, "profit/loss per day");

You can use the following methods:

« The Line object The Arrow object »