Subversion Repositories Applications.papyrus

Rev

Rev 1372 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
1422 alexandre_ 11
 
12
 
1318 alexandre_ 13
dojo.provide("dojo.charting.vml.PlotArea");
14
dojo.require("dojo.lang.common");
15
if (dojo.render.vml.capable) {
16
	dojo.extend(dojo.charting.PlotArea, {resize:function () {
17
		var a = this.getArea();
18
		this.nodes.area.style.width = this.size.width + "px";
19
		this.nodes.area.style.height = this.size.height + "px";
20
		this.nodes.background.style.width = this.size.width + "px";
21
		this.nodes.background.style.height = this.size.height + "px";
22
		this.nodes.plots.width = this.size.width + "px";
23
		this.nodes.plots.height = this.size.height + "px";
24
		this.nodes.plots.style.clip = "rect(" + a.top + " " + a.right + " " + a.bottom + " " + a.left + ")";
25
		if (this.nodes.axes) {
26
			this.nodes.area.removeChild(this.nodes.axes);
27
		}
28
		var axes = this.nodes.axes = document.createElement("div");
29
		axes.id = this.getId() + "-axes";
30
		this.nodes.area.appendChild(axes);
31
		var ax = this.getAxes();
32
		for (var p in ax) {
33
			var obj = ax[p];
34
			axes.appendChild(obj.axis.initialize(this, obj.plot, obj.drawAgainst, obj.plane));
35
		}
36
	}, initializePlot:function (plot) {
37
		plot.destroy();
38
		plot.dataNode = document.createElement("div");
39
		plot.dataNode.id = plot.getId();
40
		return plot.dataNode;
41
	}, initialize:function () {
42
		this.destroy();
43
		var main = this.nodes.main = document.createElement("div");
44
		var area = this.nodes.area = document.createElement("div");
45
		area.id = this.getId();
46
		area.style.position = "absolute";
47
		main.appendChild(area);
48
		var bg = this.nodes.background = document.createElement("div");
49
		bg.id = this.getId() + "-background";
50
		bg.style.position = "absolute";
51
		bg.style.top = "0px";
52
		bg.style.left = "0px";
53
		bg.style.backgroundColor = "#fff";
54
		area.appendChild(bg);
55
		var a = this.getArea();
56
		var plots = this.nodes.plots = document.createElement("div");
57
		plots.id = this.getId() + "-plots";
58
		plots.style.position = "absolute";
59
		plots.style.top = "0px";
60
		plots.style.left = "0px";
61
		area.appendChild(plots);
62
		for (var i = 0; i < this.plots.length; i++) {
63
			plots.appendChild(this.initializePlot(this.plots[i]));
64
		}
65
		this.resize();
66
		return main;
67
	}});
68
}
69