File: numeric-gviz.html

package info (click to toggle)
dygraphs 2.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,340 kB
  • sloc: javascript: 24,842; sh: 800; python: 581; makefile: 45
file content (36 lines) | stat: -rw-r--r-- 1,498 bytes parent folder | download | duplicates (2)
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
<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>numeric gviz</title>

    <link rel="stylesheet" type="text/css" href="../dist/dygraph.css" />
    <link rel="stylesheet" type="text/css" href="../common/vextlnk.css" />
    <script type="text/javascript" src="../dist/dygraph.js"></script>

    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript"><!--//--><![CDATA[//><!--
    Dygraph.onDOMready(function onDOMready() {
      google.load("visualization", "1", {"packages":[ "columnchart"]});
      google.setOnLoadCallback(drawchart);

      function drawchart() {
          var tableString =
              "{cols:[{id:'point',label:'n',type:'number',pattern:''}," +
              "{id:'0',label:'0',type:'number',pattern:''}," +
              "{id:'stddev',label:'stddev',type:'number',pattern:''}]," +
              "rows:[{c:[{v:0.0},{v:41.97},{v:17.86}]},{c:[{v:1.0},{v:11.71},{v:17.86}]},{c:[{v:2.0},{v:43.26},{v:17.86}]}]}";
          data = new google.visualization.DataTable(eval('(' + tableString + ')'));
          chart = new Dygraph.GVizChart(document.getElementById(
                "graph"));
          chart.draw(data, {errorBars: true, showRoller: true, includeZero: true });
      }
    });
    //--><!]]></script>
  </head>
  <body>
  <p>This tests that dygraphs can display gviz DataTable's with a numeric
  x-axis.</p>
  <div id="graph" style="width: 800px; height: 400px;"></div>
  </body>
</html>