1
我已經在指令中入侵了包含簡單餅圖的指令。下面是jsfiddle的確切示例。但是,一旦我試圖將其移動到我的網絡應用程序,我得到的圖形是建立在以前的會議(疊加)之上,但沒有動畫。我沒有控制檯錯誤。當我爲數據做日誌時,數據傳遞正確。D3動畫(過渡)不適用於Angular應用程序
這是我目前使用的軟件: AngularJS V1.2.1, D3版本: 「3.4.13」, 正由Express和託管的NodeJS。
任何可能導致此錯誤的建議。我不想每次獲取新數據時都要重置SVG,我希望能夠平滑過渡。
var App = angular.module('App', ['ngRoute', 'ngCookies']);
App.directive('barsChart', function($parse) {
d3.edge = {};
d3.edge.donut = function module() {
var width = 460,
height = 300,
radius = Math.min(width, height)/2;
var color = d3.scale.category20();
.............//rest is the same as the js fiddle example
[found this stack](http://stackoverflow.com/questions/13740164/d3-js-transition-not-working-when-browser-is-minimised)可以幫助我找出爲什麼這不起作用。 ** requestAnimationFrame **可能導致動畫不起作用。 – 2014-11-04 19:33:47