From: gregor herrmann Date: Sat, 2 Jun 2018 00:04:04 +0000 (+0200) Subject: use realistic datetime values (i.e. '%Y-%m-%d %H:%M:%S') X-Git-Url: https://git.toastfreeware.priv.at/chrisu/seepark.git/commitdiff_plain/15e7a24e38086359c94122538a0779fcc2c22727 use realistic datetime values (i.e. '%Y-%m-%d %H:%M:%S') --- diff --git a/web/seepark_web.py b/web/seepark_web.py index 910f0a9..912b09a 100644 --- a/web/seepark_web.py +++ b/web/seepark_web.py @@ -5,9 +5,9 @@ app = Flask(__name__) def data(): data = { '0316a2193bff': [20, 19, 20, 21, 20, 21], - '0316a2193bff_x': ['2018-05-20', '2018-05-21', '2018-05-22', '2018-05-23', '2018-05-24', '2018-05-27'], + '0316a2193bff_x': ['2018-05-20 12:00:01', '2018-05-21 13:01:02', '2018-05-22 14:05:00', '2018-05-23 14:05:01', '2018-05-24 14:05:00', '2018-05-27 14:05:02'], '0316a21383ff': [27, 32, 26, 29, 30, 31], - '0316a21383ff_x': ['2018-05-21', '2018-05-22', '2018-05-23', '2018-05-24', '2018-05-25', '2018-05-27'], + '0316a21383ff_x': [ '2018-05-21 18:00:00', '2018-05-22 14:05:00', '2018-05-23 14:05:00', '2018-05-24 14:05:02', '2018-05-25 14:05:01', '2018-05-27 14:05:01'], } return jsonify(data) diff --git a/web/static/seepark_web.js b/web/static/seepark_web.js index c266172..ed81a98 100644 --- a/web/static/seepark_web.js +++ b/web/static/seepark_web.js @@ -13,13 +13,14 @@ var chart = c3.generate({ names: { '0316a2193bff': 'Wassertemperatur in 4 m Tiefe', '0316a21383ff': 'Wassertemperatur in 5 m Tiefe' - } + }, + xFormat: '%Y-%m-%d %H:%M:%S' }, axis: { x: { type: 'timeseries', tick: { - format: '%Y-%m-%d' + format: '%Y-%m-%d %H:%M:%S' } }, y: {