diff --git a/src/components/ChartView.vue b/src/components/ChartView.vue index 5a5811b..7f63d30 100644 --- a/src/components/ChartView.vue +++ b/src/components/ChartView.vue @@ -1,20 +1,65 @@ diff --git a/src/views/AppView.vue b/src/views/AppView.vue index f28830d..4f1dea7 100644 --- a/src/views/AppView.vue +++ b/src/views/AppView.vue @@ -10,12 +10,18 @@ :items="log" :columns="['data']" /> - + @@ -29,7 +35,22 @@ import ChartView from '../components/ChartView.vue'; export default { components: { TableView, ChartView }, - computed: { ...Vuex.mapState ({ log: (state) => state.log }) }, + computed: { + datasets () { + return [ + { label: 'test', field: 'data/num2', color: 'blue', fill: '#0000' }, + { label: 'abc', field: 'data/num1', color: '#ff000055', fill: '#0000' }, + { label: 'def', field: 'data/num1', color: '#00ff00', fill: '#f005' } + ]; + }, + parsed_log () { + return this.log.map ((l) => { + l.data = JSON.parse (l.data); + return l; + }); + }, + ...Vuex.mapState ({ log: (state) => state.log }) + }, mounted () { this.get_log (); },