【问题标题】:piechart using svg and react使用 svg 的饼图并做出反应
【发布时间】:2019-12-09 03:30:06
【问题描述】:

我使用本教程https://www.smashingmagazine.com/2015/07/designing-simple-pie-charts-with-css/中的 svg 模式在 React 中创建了一个饼图

我有四件

对于所有四件: stroke-dasharray: 25, 100;

对于每一件我还有: stroke-dashoffset: 0;, stroke-dashoffset: -25;, stroke-dashoffset: -50; 和 stroke-dashoffset: -75;

问题是我在第一块和最后一块之间有一个间隙,所以这些块没有完全填满圆圈。

【问题讨论】:

    标签: svg pie-chart


    【解决方案1】:

    通过查看这个类似的帖子SVG circle has a gap,我设法找出了答案

    原来我的半径为 16,整个圆超过 100%。设置 stroke-dasharray: 100,53 并将我的半径除以 1.0053 会有所帮助。

    【讨论】:

      猜你喜欢
      • 2022-08-19
      • 2019-02-13
      • 2021-08-19
      • 1970-01-01
      • 2021-03-29
      • 2021-05-17
      • 1970-01-01
      • 2018-07-01
      • 2019-10-24
      相关资源
      最近更新 更多