- this.graphDiv = MochiKit.DOM.DIV( { style: { 'width': this.width_ + "px",
- 'height': this.height_ + "px"
- }});
- appendChildNodes(enclosing, this.graphDiv);
-
- // Create the canvas to store
- // We need to subtract out some space for the x- and y-axis labels.
- // For the x-axis:
- // - remove from height: (axisTickSize + height of tick label)
- // height of tick label == axisLabelFontSize?
- // - remove from width: axisLabelWidth / 2 (maybe on both ends)
- // For the y-axis:
- // - remove axisLabelFontSize from the top
- // - remove axisTickSize from the left
-
- var canvas = MochiKit.DOM.CANVAS;
- this.canvas_ = canvas( { style: { 'position': 'absolute' },
- width: this.width_,
- height: this.height_
- });
- appendChildNodes(this.graphDiv, this.canvas_);
-
+ this.graphDiv = document.createElement("div");
+ this.graphDiv.style.width = this.width_ + "px";
+ this.graphDiv.style.height = this.height_ + "px";
+ enclosing.appendChild(this.graphDiv);
+
+ // Create the canvas for interactive parts of the chart.
+ this.canvas_ = document.createElement("canvas");
+ this.canvas_.style.position = "absolute";
+ this.canvas_.width = this.width_;
+ this.canvas_.height = this.height_;
+ this.graphDiv.appendChild(this.canvas_);
+
+ // ... and for static parts of the chart.