棒グラフを表示する
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="ja">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>Sample</title>
<link rel="stylesheet" href="css/main.css" type="text/css" media="all">
<script type="text/javascript" src="js/prototype.js" charset="shift_jis"></script>
<script type="text/javascript" src="js/excanvas.js" charset="shift_jis"></script>
<script type="text/javascript" src="js/plotr.js" charset="shift_jis"></script>
<script type="text/javascript"><!--
Event.observe(window, "load", function(){
var dataset = {
"Prototype": [[0, 25], [1, 42], [2, 44.5], [3, 47.5]],
"jQuery": [[0, 5], [1, 10], [2, 35], [3, 50.5]],
"MooTools": [[0, 10], [1, 15], [2, 12], [3, 19]]
};
var options = {
barOrientation: "vertical",
padding: {left: 150, right: 0, top: 10, bottom: 10},
backgroundColor: "#dbdbdb",
colorScheme: "#000055"
};
var gBar = new Plotr.BarChart("graph", options);
gBar.addDataset(dataset);
gBar.render();
}, false);
// --></script>
</head>
<body>
<h1>棒グラフを表示する</h1>
<div><canvas id="graph" height="300" width="600"></canvas></div>
</body>
</html>
説明などは本書を参考にしてください。