diff --git a/package.json b/package.json index 528c95542822b739c58bbdc53f51c0db67a39587..cec81094f1206d117693637aa9f92db279bb9b64 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "svg-sprite-loader": "^4.2.6", "vue": "^2.6.10", "vue-cropper": "^0.5.2", + "vue-echarts": "^5.0.0-beta.0", "vue-i18n": "^8.17.7", "vue-resource": "^1.5.1", "vue-router": "^3.0.2", diff --git a/src/components/e-charts/dashboard.vue b/src/components/e-charts/dashboard.vue new file mode 100644 index 0000000000000000000000000000000000000000..0cb0f85572fc20f5e2d769449e7f4ca891708e9e --- /dev/null +++ b/src/components/e-charts/dashboard.vue @@ -0,0 +1,165 @@ + + + + \ No newline at end of file diff --git a/src/main.js b/src/main.js index 51f15659726d6d788bf0ced36b49dcc9b327ad23..718b1ef6a1989a6bbbbc696db83c984dee798a05 100644 --- a/src/main.js +++ b/src/main.js @@ -22,8 +22,21 @@ import "@/icons" import "./assets/css/index.css"; -import echarts from 'echarts' -Vue.prototype.$echarts = echarts; + +import ECharts from "vue-echarts/components/ECharts"; +Vue.component("chart", ECharts); +// vue-echarts按需引入 +import "echarts/lib/chart/line"; // 折线 +import "echarts/lib/chart/pie"; // 饼状图 +import "echarts/lib/chart/bar"; // 柱状图 +import "echarts/lib/chart/pie"; // 柱状图 +import "echarts/lib/chart/gauge"; // 仪表盘 +import "echarts/lib/chart/radar"; // 雷达图 +import "echarts/lib/component/tooltip"; // 提示 +import "echarts/lib/component/legend"; // 图例 +import "echarts/lib/component/title"; // 标题 +import 'echarts/lib/component/polar'; // 极坐标系 +import 'echarts/lib/chart/scatter'; // 散点图 import VueI18n from 'vue-i18n' Vue.use(VueI18n) diff --git a/src/pages/data-analysis/my-service.vue b/src/pages/data-analysis/my-service.vue index 34e31c5ef56e4091ec456becd4fc8c739f47b27d..4e54a8c0b8506bcf36ab0102b4d167dc25eaba9b 100644 --- a/src/pages/data-analysis/my-service.vue +++ b/src/pages/data-analysis/my-service.vue @@ -10,7 +10,7 @@ -
+
@@ -63,172 +63,19 @@