echarts 的tooltip无法显示

时间:2022-11-02 08:10:45
this.axios
            .post("ap", {})
            .then(res => {
              if (res.data.success) {
                this.labelShow3 = true;
                this.flowTare = [];
                this.flowTare.push(
                  toDecimal2(
                    res.data.data[0].res_pool_no_used +
                      res.data.data[0].res_pool_used
                  )
                );
                this.flowTare.push(toDecimal2(res.data.data[0].res_pool_used));
                this.flowTare.push(this.cucMonthFlow);
                this.flowTare.push(this.cucDayFlow);

                costPies.setOption({
                  title: {
                    text: "联通流量池扣除量(GB)",
                    x: "center"
                  },
                  tooltip: {
                    axisPointer: {
                      // 坐标轴指示器,坐标轴触发有效
                      type: "line" // 默认为直线,可选为:'line' | 'shadow'
                    }
                  },
                  grid: {
                    containLabel: true
                  },
                  color: function(params) {
                    let colorList = [
                      "#fe8463",
                      "#9bca63",
                      "#fad860",
                      "#60c0dd"
                    ];
                    return colorList[params.dataIndex];
                  },
                  yAxis: [
                    {
                      type: "value",
                      name: "(GB)"
                    }
                  ],
                  xAxis: [
                    {
                      type: "category",
                      data: ["A", "B", "C", "D"]
                    }
                  ],
                  series: [
                    {
                      name: "扣除量",
                      type: "bar",
                      data: this.flowTare,
                      label: {
                        normal: {
                          show: true,
                          position: "top",
                          color: "#000"
                        }
                      }
                    }
                  ]
                });
              }
            });

1 个解决方案

#1


代码看着没问题,你看看是不是模板(html/css)哪里影响了它

#1


代码看着没问题,你看看是不是模板(html/css)哪里影响了它