Feat(Categories): use tags as legend for graphs

This commit is contained in:
Bertrand Benjamin 2019-01-27 20:05:41 +01:00
parent 6f069832c0
commit ecf7db6a8f
2 changed files with 14 additions and 20 deletions

View File

@ -16,15 +16,6 @@ export default {
}, },
data () { data () {
return { return {
selected_tags: [
'virements',
'cash',
'autoroute',
'train',
'essence',
'courses',
'sans tags'
],
options: { options: {
responsive: true, responsive: true,
maintainAspectRatio: false, maintainAspectRatio: false,
@ -39,8 +30,14 @@ export default {
'tag_filter_rows' 'tag_filter_rows'
]), ]),
...mapGetters('config', [ ...mapGetters('config', [
'tag' 'tag',
'tags'
]), ]),
selected_tags () {
var sel = Object.keys(this.tags)
sel.push('sans tags')
return sel
},
chartdata () { chartdata () {
return { return {
labels: this.selected_tags, labels: this.selected_tags,

View File

@ -17,15 +17,6 @@ export default {
}, },
data () { data () {
return { return {
selected_tags: [
'virements',
'cash',
'autoroute',
'train',
'essence',
'courses',
'sans tags'
],
options: { options: {
responsive: true, responsive: true,
maintainAspectRatio: false, maintainAspectRatio: false,
@ -41,8 +32,14 @@ export default {
'tag_filter_rows': 'tag_filter_rows' 'tag_filter_rows': 'tag_filter_rows'
}), }),
...mapGetters('config', [ ...mapGetters('config', [
'tag' 'tag',
'tags'
]), ]),
selected_tags () {
var sel = Object.keys(this.tags)
sel.push('sans tags')
return sel
},
datasets () { datasets () {
var datas = [] var datas = []
this.selected_tags.forEach(t => { this.selected_tags.forEach(t => {