Debian Codegraph @

htdocs/samples/axes_x_range_timeseries.html

raw
1 <html>
2 <head>
3 <link rel="stylesheet" type="text/css" href="/css/c3.css">
4 </head>
5 <body>
6 <div id="chart1"></div>
7 <div id="chart2"></div>
8
9 <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
10 <script src="/js/c3.js"></script>
11 <script>
12
13 var chart1 = c3.generate({
14 "bindto": "#chart1",
15 "axis": {
16 "x": {
17 "type": "timeseries",
18 "min": 1401879600000,
19 "max": 1401969600000,
20 }
21 },
22 "data": {
23 "type": "line",
24 "columns": [
25 ["epoch", 1401879600000, 1401883200000, 1401886800000],
26 ["y", 1955, 2419, 2262]
27 ],
28 "xs": {
29 "y": "epoch"
30 }
31 }
32 });
33
34 var chart2 = c3.generate({
35 "bindto": "#chart2",
36 "axis": {
37 "x": {
38 "type": "timeseries",
39 "min": new Date(1401879600000),
40 "max": new Date(1401969600000),
41 }
42 },
43 "data": {
44 "type": "line",
45 "columns": [
46 ["epoch", 1401879600000, 1401883200000, 1401886800000],
47 ["y", 1955, 2419, 2262]
48 ],
49 "xs": {
50 "y": "epoch"
51 }
52 }
53 });
54
55 </script>
56 </body>
57 </html>