我正在运行 7.12.0.1229,根据 Anychart : How to add animation in Pie or funnel chart of AnyChart7.1修复了几个动画问题。
尝试将 pie3d
图表类型与 chart.animation(true, 800);
结合使用时,chart.animation(true);
或 chart.animation({enabled: true,uration:uration})
图表将不会渲染。
工作示例 http://jsfiddle.net/RainerAtSpirit/c2wye9m9/3/
anychart.onDocumentReady(function() {
//dataset
var data = anychart.data.set([
["$0-$50,000", 68],
["$50,000-$100,000", 13],
["$100,000-$150,000", 6],
["$150,000-$250,000", 6],
["$250,000 - plus", 7]
])
var chart = anychart.pie3d(data);
//adjust legend
var legend = chart.legend();
legend.enabled(true);
legend.position("left");
legend.align("center");
legend.itemsLayout("vertical");
//create title
var title = chart.title();
title.text("Pop Out");
title.enabled(true);
//inner radius makes this a doughnut chart instead of pie
chart.innerRadius("30%");
//define the container
chart.container("container");
// chart.animiation breaks pie3d chart type
// chart.animation(true, 800);
//set delay to recall draw ch art to
chart.draw();
});
损坏的示例 http://jsfiddle.net/RainerAtSpirit/c2wye9m9/2/
anychart.onDocumentReady(function() {
//dataset
var data = anychart.data.set([
["$0-$50,000", 68],
["$50,000-$100,000", 13],
["$100,000-$150,000", 6],
["$150,000-$250,000", 6],
["$250,000 - plus", 7]
])
var chart = anychart.pie3d(data);
//adjust legend
var legend = chart.legend();
legend.enabled(true);
legend.position("left");
legend.align("center");
legend.itemsLayout("vertical");
//create title
var title = chart.title();
title.text("Pop Out");
title.enabled(true);
//inner radius makes this a doughnut chart instead of pie
chart.innerRadius("30%");
//define the container
chart.container("container");
// chart.animiation breaks pie3d chart type
chart.animation(true, 800);
//set delay to recall draw ch art to
chart.draw();
});
最佳答案
确实,看起来不太好,谢谢您的报告!我们已将此案例转移到我们的错误跟踪系统,因此我们将深入调查并尽快回复您。至于共同的动画功能,3d图表支持动画:
chart = anychart.bar3d([2, 8, 3, 4, 9]);
chart.animation({enabled: true, duration: 3000});
但如果 3d 饼图不起作用,我们会尽快进行调查。
关于javascript - Anychart Chart.animation 打破了 pie3d 图表类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42202963/