forked from asimturgut61/raphael-inceleme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stacked_ bar_chart.html
64 lines (58 loc) · 3.17 KB
/
stacked_ bar_chart.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<html lang="en">
<head>
<title>çizerleerr :) </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="author" content="Asim Turgut">
<meta name="description" content="grafik çizimleri">
<script type="text/javascript" src="js/raphael.js"> charset="utf-8"</script>
<script type="text/javascript" src="js/g.raphael.js"> charset="utf-8"</script>
<script type="text/javascript" src="js/g.pie.js"> charset="utf-8"</script>
<script type="text/javascript" src="js/g.bar.js"> charset="utf-8"</script>
<script type="text/javascript" src="js/g.line.js"> charset="utf-8"</script>
<script type="text/javascript" src="js/g.dot.js"> charset="utf-8"</script>
<script type="text/javascript" charset="utf-8">
window.onload = function () {
var r = Raphael("holder"),
fin = function () {
this.flag = r.g.popup(this.bar.x, this.bar.y, this.bar.value || "0").insertBefore(this);
},
fout = function () {
this.flag.animate({opacity: 0}, 300, function () {this.remove();});
},
fin2 = function () {
var y = [], res = [];
for (var i = this.bars.length; i--;) {
y.push(this.bars[i].y);
res.push(this.bars[i].value || "0");
}
this.flag = r.g.popup(this.bars[0].x, Math.min.apply(Math, y), res.join(", ")).insertBefore(this);
},
fout2 = function () {
this.flag.animate({opacity: 0}, 300, function () {this.remove();});
};
r.g.txtattr.font = "12px 'Fontin Sans', Fontin-Sans, sans-serif";
r.g.text(160, 10, "Single Series Chart");
r.g.text(630, 10, "Multiline Series Stacked Chart ile 2011 genel seçim sonuşları");
r.g.text(160, 250, "Multiple Series Chart");
r.g.text(480, 250, "Multiline Series Stacked Chart\nColumn Hover");
r.g.text(500, 30, "Trabzon:");
r.g.text(500, 70, "Rize:");
r.g.text(500, 100, "Artvin:");
r.g.text(500, 135, "Ordu:");
r.g.text(500, 165, "Samsun:");
r.g.text(500, 200, "Aydın:");
r.g.barchart(10, 10, 300, 220, [[55, 20, 13, 32, 5, 1, 2, 10]]).hover(fin, fout);
r.g.hbarchart(530, 10, 300, 220, [[59, 69, 47, 60, 62, 33], [18, 17, 35, 23, 22, 46],[15,8,14,12,11,16]], {stacked: true}).hover(fin, fout);
r.g.hbarchart(10, 250, 300, 220, [[55, 20, 13, 32, 5, 1, 2, 10], [10, 2, 1, 5, 32, 13, 20, 55]]).hover(fin, fout);
var c = r.g.barchart(330, 250, 300, 220, [[55, 20, 13, 32, 5, 1, 2, 10], [10, 2, 1, 5, 32, 13, 20, 55]], {stacked: true, type: "soft"}).hoverColumn(fin2, fout2);
// c.bars[1].attr({stroke: "#000"});
};
</script>
</head>
<body >
<div id="holder"></div>
<p>
Sonuçların Grafiğe dökülü hali yukardaki gibidir.
</p>
</body>
</html>