From 8a4d7cf10d6764179e58481edc98b1ee765ce25d Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Thu, 30 Jul 2020 22:24:07 +0200 Subject: [PATCH] correct layout, add chart --- package.json | 2 ++ seeds/fake.js | 2 +- src/components/ChartView.vue | 23 ++++++++++++++ src/components/TableView.vue | 53 ++++++++++++++++++++++++-------- src/views/AppView.vue | 59 +++++++++++++++++------------------- yarn.lock | 35 ++++++++++++++++++++- 6 files changed, 128 insertions(+), 46 deletions(-) create mode 100644 src/components/ChartView.vue diff --git a/package.json b/package.json index e6f1847..d87c7d3 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@sapphirecode/password-helper": "^1.0.47", "@sapphirecode/ui-modules": "^0.1.1", "body-parser": "^1.19.0", + "chart.js": "^2.9.3", "connect-history-api-fallback": "^1.6.0", "cookie-parser": "^1.4.5", "core-js": "^3.6.5", @@ -25,6 +26,7 @@ "knex": "^0.21.2", "sqlite3": "^5.0.0", "vue": "^2.6.11", + "vue-chartjs": "^3.5.0", "vue-router": "^3.2.0", "vuex": "^3.4.0" }, diff --git a/seeds/fake.js b/seeds/fake.js index 2458a12..acf8d94 100644 --- a/seeds/fake.js +++ b/seeds/fake.js @@ -18,7 +18,7 @@ function create_log () { async function seed (knex) { console.log ('creating seeds'); - const log = (Array (100)) + const log = (Array (20)) .fill (() => null) .map (() => create_log ()); await knex ('log') diff --git a/src/components/ChartView.vue b/src/components/ChartView.vue new file mode 100644 index 0000000..5a5811b --- /dev/null +++ b/src/components/ChartView.vue @@ -0,0 +1,23 @@ + + + diff --git a/src/components/TableView.vue b/src/components/TableView.vue index 1959fc6..dce2708 100644 --- a/src/components/TableView.vue +++ b/src/components/TableView.vue @@ -1,16 +1,21 @@ diff --git a/src/views/AppView.vue b/src/views/AppView.vue index 4dc422e..f28830d 100644 --- a/src/views/AppView.vue +++ b/src/views/AppView.vue @@ -1,39 +1,35 @@