我正在基于https://bl.ocks.org/alandunning/4c36eb1abdb248de34c64f5672afd857-
改进此径向图我已经创建了这两个版本-但想集成一些数据源
我也很奇怪如何将数据复制为变量d-然后对原始数据对象本身执行此过程-是否需要进行变量的克隆-图表的其余部分不能使用新修改的数据变量?
d.forEach(function(y, x){
dataValues = [];
radial.selectAll(".nodes")
.data(y, function(j, i){
dataValues.push([
cfg.w/2*(1-(parseFloat(Math.max(j.value, 0))/cfg.maxValue)*cfg.factor*Math.sin(i*cfg.radians/total)),
cfg.h/2*(1-(parseFloat(Math.max(j.value, 0))/cfg.maxValue)*cfg.factor*Math.cos(i*cfg.radians/total))
]);
});
dataValues.push(dataValues[0]);
//版本1 https://jsfiddle.net/z47c06u8/
//版本2-具有工具提示和y轴 https://jsfiddle.net/er8pwj95/1/