From ecf7db6a8f2dd7ee4a53e7d12d3581ad44b8b4a3 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Sun, 27 Jan 2019 20:05:41 +0100 Subject: [PATCH] Feat(Categories): use tags as legend for graphs --- src/components/graph_tags_comparison.vue | 17 +++++++---------- src/components/graph_time.vue | 17 +++++++---------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/components/graph_tags_comparison.vue b/src/components/graph_tags_comparison.vue index e9647c7..81faf9d 100644 --- a/src/components/graph_tags_comparison.vue +++ b/src/components/graph_tags_comparison.vue @@ -16,15 +16,6 @@ export default { }, data () { return { - selected_tags: [ - 'virements', - 'cash', - 'autoroute', - 'train', - 'essence', - 'courses', - 'sans tags' - ], options: { responsive: true, maintainAspectRatio: false, @@ -39,8 +30,14 @@ export default { 'tag_filter_rows' ]), ...mapGetters('config', [ - 'tag' + 'tag', + 'tags' ]), + selected_tags () { + var sel = Object.keys(this.tags) + sel.push('sans tags') + return sel + }, chartdata () { return { labels: this.selected_tags, diff --git a/src/components/graph_time.vue b/src/components/graph_time.vue index 9484cd7..3cc0f19 100644 --- a/src/components/graph_time.vue +++ b/src/components/graph_time.vue @@ -17,15 +17,6 @@ export default { }, data () { return { - selected_tags: [ - 'virements', - 'cash', - 'autoroute', - 'train', - 'essence', - 'courses', - 'sans tags' - ], options: { responsive: true, maintainAspectRatio: false, @@ -41,8 +32,14 @@ export default { 'tag_filter_rows': 'tag_filter_rows' }), ...mapGetters('config', [ - 'tag' + 'tag', + 'tags' ]), + selected_tags () { + var sel = Object.keys(this.tags) + sel.push('sans tags') + return sel + }, datasets () { var datas = [] this.selected_tags.forEach(t => {