0
My data(dc.js)的網站怎麼看用餅圖(我的意思是一年過濾器)
VAR NDX = crossfilter(實驗)僅一年時間值,
runDimension = ndx.dimension(function(d) {return d.name;})
speedSumGroup = runDimension.group().reduceSum(function(d) {return d.price;});
這是我的圖表製作功能。不工作看到只有一年幫助我。 –
圖表 .WIDTH(308) .height(220) .slicesCap(4) .innerRadius(30) .dimension(runDimension) 。集團(speedSumGroup) .legend(dc.legend()) 。 ordinalColors([「#8A8AD6」,「#00BBDE」,「#FE6672」,「#EEB058」]) //解決方法#703:沒有足夠的數據可通過.label()訪問以顯示百分比 .on '轉變前',函數(圖表){ chart.selectAll( 'text.pie切片')。文本(函數(d){ 返回d.data.key + '' + dc.utils.printSingleValue((d。 endAngle - d.startAngle)/(2 * Math.PI)* 100)+'%'; }) }); –