e30d414f33339470481727757e486e0c7cef60d7
[chrisu/seepark.git] / web / static / seepark_web.js
1 var chart = c3.generate({
2         bindto: '#chart',
3         title: {
4                 text: 'Temperaturen'
5         },
6         data: {
7                 url: '/data',
8                 mimeType: 'json',
9                 xs: {
10                         '0316a2193bff': '0316a2193bff_x',
11                         '0316a21383ff': '0316a21383ff_x'
12                 },
13                 names: {
14                         '0316a2193bff': 'Wassertemperatur in 4 m Tiefe',
15                         '0316a21383ff': 'Wassertemperatur in 5 m Tiefe'
16                 },
17                 xFormat: '%Y-%m-%d %H:%M:%S'
18         },
19         axis: {
20                 x: {
21                         type: 'timeseries',
22                         tick: {
23                                 format: '%Y-%m-%d %H:%M:%S'
24                         }
25                 },
26                 y: {
27                         label: {
28                                 text: '°C',
29                                 position: 'outer-middle'
30                         }
31                 }
32         },
33         zoom: {
34                 enabled: true
35         },
36         tooltip: {
37                 format: {
38                         name: function (name, ratio, id, index) {
39                                 var re = /\d m/;
40                                 var res = re.exec(name);
41                                 return res;
42                         }
43                 }
44         }
45 });
46