From 1083a173867d86555e65d83ce51da69ba678cc6b Mon Sep 17 00:00:00 2001 From: Pan Date: Thu, 27 Jul 2017 14:12:31 +0800 Subject: [PATCH] fix chart bug --- src/views/dashboard/editor/lineChart.vue | 4 +++- src/views/dashboard/editor/pieChart.vue | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/dashboard/editor/lineChart.vue b/src/views/dashboard/editor/lineChart.vue index 5e188e7d..156ea525 100644 --- a/src/views/dashboard/editor/lineChart.vue +++ b/src/views/dashboard/editor/lineChart.vue @@ -35,7 +35,9 @@ this.initChart(); if (this.autoResize) { this.__resizeHanlder = debounce(() => { - this.chart.resize() + if (this.chart) { + this.chart.resize() + } }, 100) window.addEventListener('resize', this.__resizeHanlder) } diff --git a/src/views/dashboard/editor/pieChart.vue b/src/views/dashboard/editor/pieChart.vue index e520f434..5879bce8 100644 --- a/src/views/dashboard/editor/pieChart.vue +++ b/src/views/dashboard/editor/pieChart.vue @@ -52,7 +52,7 @@ legend: { x: 'center', y: 'bottom', - data: ['industries', 'technology', 'gold', 'forex', 'forecasts', 'markets'] + data: ['industries', 'technology', 'forex', 'gold', 'forecasts', 'markets'] }, calculable: true, series: [ @@ -65,7 +65,7 @@ { value: 240, name: 'technology' }, { value: 149, name: 'forex' }, { value: 100, name: 'gold' }, - { value: 59, name: 'forecastsx' }, + { value: 59, name: 'forecasts' }, { value: 49, name: 'markets' } ], animationEasing: 'cubicInOut',