|
@@ -0,0 +1,86 @@
|
|
|
+<template>
|
|
|
+ <div id="one">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <div id="chartPie" style="height: 450px"></div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import * as echarts from 'echarts';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+export default {
|
|
|
+ name: 'one',
|
|
|
+ props: {},
|
|
|
+ components: {},
|
|
|
+ data: function () {
|
|
|
+ return {};
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ mounted() {
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ var chartDom = document.getElementById('chartPie');
|
|
|
+ var myChart = echarts.init(chartDom);
|
|
|
+ var option;
|
|
|
+ option = {
|
|
|
+ legend: {
|
|
|
+ top: 'bottom',
|
|
|
+ },
|
|
|
+ toolbox: {
|
|
|
+ show: false,
|
|
|
+ feature: {
|
|
|
+ mark: { show: true },
|
|
|
+ dataView: { show: true, readOnly: false },
|
|
|
+ restore: { show: true },
|
|
|
+ saveAsImage: { show: true },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ name: '饼状图',
|
|
|
+ type: 'pie',
|
|
|
+ radius: '70%',
|
|
|
+ center: ['50%', '50%'],
|
|
|
+ roseType: 'area',
|
|
|
+ itemStyle: {
|
|
|
+ borderRadius: 8,
|
|
|
+ },
|
|
|
+ data: [
|
|
|
+ { value: 40, name: 'rose 1' },
|
|
|
+ { value: 38, name: 'rose 2' },
|
|
|
+ { value: 32, name: 'rose 3' },
|
|
|
+ { value: 30, name: 'rose 4' },
|
|
|
+ { value: 28, name: 'rose 5' },
|
|
|
+ { value: 26, name: 'rose 6' },
|
|
|
+ { value: 22, name: 'rose 7' },
|
|
|
+ { value: 18, name: 'rose 8' },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ };
|
|
|
+
|
|
|
+ option && myChart.setOption(option);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ metaInfo() {
|
|
|
+ return { title: this.$route.meta.title };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ test: {
|
|
|
+ deep: true,
|
|
|
+ immediate: true,
|
|
|
+ handler(val) {},
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped></style>
|