CustomerAnalyse.vue 2.21 KB
Newer Older
1
<template>
潘际乾 committed
2 3 4
  <div class="home-cell" id="customerAnalyse">
    <CellHeaderVue title="大客户分析">
      <span class="el-icon-refresh" title="刷新"></span>
潘际乾 committed
5
      <span class="el-icon-more" title="操作"></span>
潘际乾 committed
6 7
    </CellHeaderVue>
    <div class="cell-content">
8 9 10 11 12 13 14 15 16 17
      <div class="chart-operate">
        <i class="el-icon-arrow-up"></i>
        <i class="el-icon-arrow-down"></i>
      </div>
      <div id="chart"></div>
    </div>
  </div>
</template>

<script>
潘际乾 committed
18
import CellHeaderVue from "./CellHeader.vue";
19 20 21 22
import * as echarts from "echarts";

export default {
  name: "CustomerAnalyse",
潘际乾 committed
23
  components: { CellHeaderVue },
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
  data() {
    return {};
  },
  mounted() {
    const echartInstance = echarts.init(document.getElementById("chart"));
    const option = {
      title: {
        // text: "Test Demo",
      },
      tooltip: {
        trigger: "axis",
        axisPointer: {
          type: "shadow",
        },
      },
      legend: {
        bottom: "2%",
      },
      grid: {
        left: "1%",
        right: "6%",
        top: "1%",
        containLabel: true,
      },
      xAxis: {
        type: "value",
        boundaryGap: [0, 0.01],
      },
      yAxis: {
        type: "category",
        data: [
          "总行国际业务中心",
          "盛世饮料",
          "中国华润总公司",
          "东风汽车公司",
          "恒大集团",
          "万康食品",
        ],
      },
      series: [
        {
          name: "业务量(万美元)",
          type: "bar",
          data: [18203, 23489, 29034, 104970, 131744, 230230],
        },
        {
          name: "融资量(万美元)",
          type: "bar",
          data: [19325, 23438, 31000, 121594, 134141, 381807],
        },
        {
潘际乾 committed
75
          name: "费用收益(千美元)",
76 77 78 79 80 81 82 83 84 85 86
          type: "bar",
          data: [49325, 53438, 11000, 221594, 43241, 455807],
        },
      ],
    };
    echartInstance.setOption(option);
  },
};
</script>

<style scoped>
潘际乾 committed
87
#customerAnalyse .cell-content .chart-operate {
88 89 90
  margin-left: 20px;
  height: 20px;
}
潘际乾 committed
91
#customerAnalyse .cell-content .chart-operate i {
92 93
  cursor: pointer;
}
潘际乾 committed
94
#customerAnalyse .cell-content #chart {
95
  width: 98%;
96
  height: calc(100% - 25px);
97 98 99
  margin: 0 auto;
}
</style>