Skip to content

Instantly share code, notes, and snippets.

@ocean
Created November 2, 2009 01:56
Show Gist options
  • Save ocean/223884 to your computer and use it in GitHub Desktop.
Save ocean/223884 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>g.RaphaelJS Graph Testing</title>
<script src='raphael-min.js'></script>
<script src='g.raphael-min.js'></script>
<script src='g.line-min.js'></script>
<script type='text/javascript'>
//<![CDATA[
window.onload = function () {
var r = Raphael("graph-area", 500, 500);
/* Graph input */
/* 2009 */
var ie7 = [[1, 2, 3, 4, 5, 6, 7, 8, 9],[25.7, 25.4, 24.9, 23.2, 21.3, 18.7, 15.9, 15.1, 15.3]];
var ie6 = [[1, 2, 3, 4, 5, 6, 7, 8, 9],[18.5, 17.4, 17.0, 15.4, 14.5, 14.9, 14.4, 13.6, 12.1]];
var ie8 = [[1, 2, 3, 4, 5, 6, 7, 8, 9],[0.6, 0.8, 1.4, 3.5, 5.2, 7.1, 9.1, 10.6, 12.2]];
var ff = [[1, 2, 3, 4, 5, 6, 7, 8, 9],[45.5, 46.4, 46.5, 47.1, 47.7, 47.3, 47.9, 47.4, 46.6]];
var chrome = [[1, 2, 3, 4, 5, 6, 7, 8, 9],[3.9, 4, 4.2, 4.9, 5.5, 6, 6.5, 7, 7.1]];
var safari = [[1, 2, 3, 4, 5, 6, 7, 8, 9],[3, 3, 3.1, 3, 3, 3.1, 3.3, 3.3, 3.6]];
/*var y = [];
for (var i = 0; i < 500; i++) {
y[i] = (y[i - 1] || 0) + (Math.random() * 7) - 3;
}*/
r.g.linechart(150, 200, 500, 500, ie6, ie7, ie8, ff, chrome, safari, {nostroke: false, axis: "0 0 0 0 1 1", symbol: "o"})
/*var lines = r.g.linechart(150, 200, 500, 500, ie6, ie7, ie8, ff, chrome, safari, {nostroke: false, axis: "0 0 0 0 1 1", symbol: "o"}).hoverColumn(function () {
this.tags = r.set();
for (var i = 0, ii = 9; i < ii; i++) {
this.tags.push(r.g.tag(this.x, this.y[i], this.values[i], 160, 10).insertBefore(this).attr([{fill: "#fff"}, {fill: this.symbols[i].attr("fill")}]));
}
}, function () {
this.tags && this.tags.remove();
});*/
};
//]]>
</script>
</head>
<body>
<div id='graph-area'></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment