管道基础大数据平台系统开发-【前端】-新系統界面
1
Surpriseplus
2022-12-19 9c803f20cc05395bac2d3386accfe230210c07dc
src/components/echart41.vue
@@ -10,75 +10,78 @@
  components: {},
  data() {
    //这里存放数据
    return {};
    return { myChart };
  },
  mounted() {
    this.lineChart();
    this.$bus.$on('resizeEchart', (res) => {
      this.myChart.resize();
    });
  },
  //方法集合
  methods: {
    lineChart() {
      let option = {
        title: {
          text: "项目服务分类",
          text: '项目服务分类',
          textStyle: {
            color: "#fff",
            color: '#fff',
          },
        },
        tooltip: {
          trigger: "axis",
          trigger: 'axis',
          axisPointer: {
            type: "shadow",
            type: 'shadow',
          },
        },
        // legend: {},
        grid: {
          left: "0%",
          right: "4%",
          bottom: "0%",
          left: '0%',
          right: '4%',
          bottom: '0%',
          containLabel: true,
        },
        xAxis: {
          type: "value",
          type: 'value',
          boundaryGap: [0, 0.01],
          axisLine: {
            lineStyle: {
              color: "#ccc",
              color: '#ccc',
            },
          },
          axisLabel: {
            show: true,
            textStyle: {
              color: "#fff",
              color: '#fff',
            },
          },
        },
        yAxis: {
          type: "category",
          type: 'category',
          data: [
            "问题解析",
            "需求反馈",
            "专题服务",
            "现场支持",
            "版本升级",
            "技术培训",
            '问题解析',
            '需求反馈',
            '专题服务',
            '现场支持',
            '版本升级',
            '技术培训',
          ],
          axisLine: {
            lineStyle: {
              color: "#ccc",
              color: '#ccc',
            },
          },
          axisLabel: {
            show: true,
            textStyle: {
              color: "#fff",
              color: '#fff',
            },
          },
        },
        series: [
          {
            name: "项目服务分类",
            type: "bar",
            name: '项目服务分类',
            type: 'bar',
            barWidth: 20,
            data: [120, 45, 5, 15, 4, 12],
            itemStyle: {
@@ -87,12 +90,12 @@
                barBorderRadius: [0, 90, 90, 0],
                color: (params) => {
                  var colorList = [
                    ["#00FCFF", "#008297"],
                    ["#0091FF", "#005EA4"],
                    ["#901698", "#F157EE"],
                    ["#40FBCB", "#009871"],
                    ["#FF515A", "#FFDD53"],
                    ["#6574E2", "#261164"],
                    ['#00FCFF', '#008297'],
                    ['#0091FF', '#005EA4'],
                    ['#901698', '#F157EE'],
                    ['#40FBCB', '#009871'],
                    ['#FF515A', '#FFDD53'],
                    ['#6574E2', '#261164'],
                  ];
                  var colorItem = colorList[params.dataIndex];
                  return new this.$echarts.graphic.LinearGradient(
@@ -118,10 +121,10 @@
          },
        ],
      };
      let myChart = this.$echarts.init(document.getElementById("echart41"));
      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      this.myChart = this.$echarts.init(document.getElementById('echart41'));
      this.myChart.setOption(option);
      window.addEventListener('resize', function () {
        this.myChart.resize();
      });
    },
  },