当数据发生变化时,我试图绘制一个饼图。下面是一个代码片段
var piePlot = new Plottable.Plots.Pie()
.addDataset(dataset)
.outerRadius(function() { return Math.floor(piePlot.width()/10) + 40 })
.innerRadius(function() { return Math.floor(piePlot.width()/10) })
.sectorValue(function(d) { return d.y; })
.attr("fill", function(d) { return d.x; }, colorScale)
.attr("opacity",0.8)
.animated(true)
.animator(Plottable.Plots.Animator.MAIN,new Plottable.Animators.Easing().easingMode("quad").stepDuration(3500));我的困惑是动画作品是伟大的图表,如线图和面积图,但不适用于其他图表,如矩形图,饼图,散点图等。为什么是这样?我们需要做一个定制的动画功能吗?如果是,请你引导我..。
就像我说的,这是完美的
var linePlot = new Plottable.Plots.Line()
.addDataset(dataset)
.x(function(d) { return d.x; }, xScale)
.y(function(d) { return d.y; }, yScale)
.attr("stroke","#FA8116")
.animated(true)
.animator(Plottable.Plots.Animator.MAIN,new Plottable.Animators.Easing().easingMode("quad").stepDuration(3500));发布于 2015-12-18 07:57:58
显然,对于饼图和矩形图似乎没有动画支持的实现。
https://stackoverflow.com/questions/34307991
复制相似问题