e1ecd8b6fadf62cd8a503ff056c88ef9885ab59a
[dygraphs.git] / plotkit_v091 / tests / debug.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3 <head>
4 <title>PlotKit: Debug</title>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <link href="/css/page.css" media="screen" rel="Stylesheet"
7 type="text/css" />
8 <link href="tests.css" media="screen" rel="Stylesheet" type="text/css" />
9 <script src="/js/mochi/MochiKit.js" type="text/javascript"></script>
10 <script src="/js/plotkit-svn/excanvas.js" type="text/javascript"></script>
11 <script src="/js/plotkit-svn/Base.js" type="text/javascript"></script>
12 <script src="/js/plotkit-svn/Layout.js" type="text/javascript"></script>
13 <script src="/js/plotkit-svn/Canvas.js" type="text/javascript"></script>
14 <script src="/js/plotkit-svn/SweetCanvas.js" type="text/javascript"></script>
15
16 </head>
17
18
19 <body>
20 <div id="body">
21 <h2>Debug</h2>
22
23 <div style="margin: 0 auto 0 auto; width: 500px;">
24 <div><canvas id="chart" width="500" height="300"></canvas></div>
25
26 <script type="text/javascript">
27 var options = {
28 "padding": {left: 20, right: 0, top: 10, bottom: 30},
29 "yAxis": [0, 60]
30 }
31
32 function drawGraph() {
33 var layoutOptions = {
34 "xAxis" : [1, 4],
35 "xOriginIsZero" : false,
36 "xTicks" : [ {v: 0}, {v: 1}, {v: 2}, {v: 3}, {v: 4}, {v: 5} ],
37 "yAxis" : [1, 4],
38 "yOriginIsZero" : false,
39 "yTicks" : [ {v: 0}, {v: 1}, {v: 2}, {v: 3}, {v: 4}, {v: 5} ]
40 };
41 var layout = new PlotKit.Layout("line", layoutOptions);
42 layout.addDataset("myDataset", [ [1, 1], [2, 2], [3, 3], [4, 4] ]);
43 layout.evaluate();
44
45 var canvas = MochiKit.DOM.getElement("chart");
46 var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, options);
47 plotter.render();
48 }
49 MochiKit.DOM.addLoadEvent(drawGraph);
50
51 </script>
52 </div>
53
54 <div class="footer"><a href="http://www.liquidx.net/plotkit/">PlotKit</a></div>
55 </div>
56 </body></html>