<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>使用圆弧生成器</title>
<script src="../js/d3.js"></script>
</head>
<body>
<script>
const width = 400, height = 400, fullAngle = 2 * Math.PI, colors = d3.scaleOrdinal(d3.schemeCategory10)
const svg = d3.select('body')
.append('svg')
.attr('class', 'pie')
.attr('height', height)
.attr('width', width)
function render(innerRadius, endAngle) {
if(!endAngle) endAngle = fullAngle
const data = [
{startAngle: 0, endAngle: 0.2 * endAngle},
{startAngle: 0.2 * endAngle, endAngle: 0.5 * endAngle},
{startAngle: 0.5 * endAngle, endAngle: 0.8 * endAngle},
{startAngle: 0.8 * endAngle, endAngle: 1 * endAngle}
]
const arc = d
d3 实现圆弧过渡的效果
最新推荐文章于 2023-06-10 10:52:09 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)