Debian Codegraph @

htdocs/samples/grid_x_lines_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 "tick": {
19 format: '%Y-%m-%d %H:%M:%S'
20 }
21 }
22 },
23 "grid": {
24 "x": {
25 "lines": [
26 { "value": 1401883200000, "text": new Date(1401883200000), "color": "#f00" },
27 ]
28 }
29 },
30 "data": {
31 "type": "line",
32 "columns": [
33 ["epoch", 1401879600000, 1401883200000, 1401886800000],
34 ["y", 1955, 2419, 2262]
35 ],
36 "xs": {
37 "y": "epoch"
38 }
39 }
40 });
41
42 var chart2 = c3.generate({
43 "bindto": "#chart2",
44 "axis": {
45 "x": {
46 "type": "timeseries",
47 "tick": {
48 format: '%Y-%m-%d %H:%M:%S'
49 }
50 }
51 },
52 "grid": {
53 "x": {
54 "lines": [
55 { "value": new Date(1401883200000), "text": new Date(1401883200000), "color": "#f00" },
56 ]
57 }
58 },
59 "data": {
60 "type": "line",
61 "columns": [
62 ["epoch", 1401879600000, 1401883200000, 1401886800000],
63 ["y", 1955, 2419, 2262]
64 ],
65 "xs": {
66 "y": "epoch"
67 }
68 }
69 });
70
71 </script>
72 </body>
73 </html>