请问echarts怎么实现饼图圆环这种效果

新手上路,请多包涵

image.png
没看到有参数可以调整这种交界处边界

阅读 1.4k
1 个回答
新手上路,请多包涵

其实用html + css 也可以实现。

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .pie {
        width: 300px;
        height: 300px;
        border-radius: 50%;
        display: flex;
        flex-direction: row;
        overflow: hidden;
        position: relative;
        transform: rotate(-30deg);
      }

      .one {
        background: red;
        width: 20%;
        height: 100%;
      }

      .two {
        background: blue;
        width: 40%;
        height: 100%;
      }

      .three {
        background: yellow;
        width: 40%;
        height: 100%;
      }

      .small-box {
        width: 80%;
        height: 80%;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background: white;
        border-radius: 50%;

      }
    </style>
  </head>
  <body>
    <div class="pie">
      <div class="one"></div>
      <div class="two"></div>
      <div class="three"></div>
      <div class="small-box"></div>
    </div>
  </body>
</html>
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题