老师这节课的tooltip 怎么没有配置?

来源:2-11 今日交易用户数组件开发

空白格3207694

2022-01-04

写回答

1回答

晓之蛇

2022-11-14

自己加的tooltip,供参考

  mounted() {
    const chartDOM = document.getElementById("today-users-chart");
    const chart = this.$echarts.init(chartDOM);
    const options = {
      color:["#3398DB"],
      tooltip: {
        trigger: 'axis',
        backgroundColor: 'rgba(0,0,0,0.5)',
        textStyle:{
          color: "#fff",
          fontWeight:"normal"
        }
      },
      xAxis: {
        type:"category",
        show: false,
        data:["00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00"]
      },
      yAxis: {
        show: false
      },
      series: [
        {
          name:"直接访问",
          type: "bar",
          data: [ 410, 82, 200, 334, 390, 330, 220, 150, 82, 200, 134, 290, 330, 150],
          barWdith:"60%"
        },
      ],
      grid: {
        top: 0,
        bottom: 0,
        left: 0,
        right: 0,
      },
    };
    chart.setOption(options);
  },


0
0

Vue + EChart 4.0 从0到1打造商业级数据报表项目

数据可视化是未来前端技术的标配,是未来前端竞争的破冰利器

5701 学习 · 79 问题

查看课程