Echart图表里的tooltip超出范围的处理

使用confine:'true’的属性将内容限定在范围内,为了美观,可以写一个回调函数将tooltip固定在顶部

 tooltip: {
          trigger: 'item',
          formatter: "{b}: {c}GB ({d}%)",
          confine:'true',//限制在显示框里
           // 固定在顶部
          position: function (point) { 
            return [point[0], '10%'];
        }       
      },
发布了18 篇原创文章 · 获赞 1 · 访问量 3828

猜你喜欢

转载自blog.csdn.net/qq_36398269/article/details/102803459
今日推荐