d3 pie chart transition with attrtween

ぐ巨炮叔叔 提交于 2019-12-02 01:29:37

after quite some variations and tests it somehow started to work, using these to lines of code:

var pie = d3.layout.pie().sort(null).startAngle(-90*grad).endAngle(90*grad);

var i = d3.interpolate({startAngle: -90*grad, endAngle: -90*grad},a);

one final "problem" was that the height of the svg was too small and so some segments got cut off, so changing it to

var height = 800;

ended my search. thanks for any considerations.

A small typo on the

var svg = d3.select("body").append("svg").attr("width", width).attr("height", `height)

should be:

var svg = d3.select("body").append("svg").attr("width", width).attr("height", height)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!