5
A
回答
1
2
顯然這還不存在。有一個問題(https://github.com/novus/nvd3/issues/150)被關閉,因爲這顯然很難實現。
4
重複的How to display values in Stacked Multi-bar chart - nvd3 Graphs
有一個修復程序,你可以在https://gist.github.com/topicus/217444acb4204f364e46
編輯自己實現:複製的代碼,如果GitHub的鏈接被刪除:
// You need to apply this once all the animations are already finished. Otherwise labels will be placed wrongly.
d3.selectAll('.nv-multibar .nv-group').each(function(group){
var g = d3.select(this);
// Remove previous labels if there is any
g.selectAll('text').remove();
g.selectAll('.nv-bar').each(function(bar){
var b = d3.select(this);
var barWidth = b.attr('width');
var barHeight = b.attr('height');
g.append('text')
// Transforms shift the origin point then the x and y of the bar
// is altered by this transform. In order to align the labels
// we need to apply this transform to those.
.attr('transform', b.attr('transform'))
.text(function(){
// Two decimals format
return parseFloat(bar.y).toFixed(2);
})
.attr('y', function(){
// Center label vertically
var height = this.getBBox().height;
return parseFloat(b.attr('y')) - 10; // 10 is the label's magin from the bar
})
.attr('x', function(){
// Center label horizontally
var width = this.getBBox().width;
return parseFloat(b.attr('x')) + (parseFloat(barWidth)/2) - (width/2);
})
.attr('class', 'bar-values');
});
});
相關問題
- 1. NVD3散點圖不顯示
- 2. Angular-nvD3餅圖不顯示
- 3. nvd3多條形圖:切換默認值以顯示
- 4. 如何使用nvd3折線圖在x軸上顯示日期
- 5. NVD3示例圖表不顯示
- 6. 如何顯示圖像直方圖上的範圍值?
- 7. 如何在nvd3.js的x軸上顯示確切的日期?
- 8. 如何指定要在位圖上顯示位圖的座標?
- 9. NVD3曲線圖X軸僅顯示最初的9個值
- 10. nvd3不顯示數值爲1000或更高的數據圖
- 11. NVD3累積折線圖顯示錯誤的y值
- 12. 如何繪製nvd3.js圖的上限
- 13. 顯示K和M在角nvd3圖Yaxis
- 14. 如何在Google地圖上顯示多個位置?
- 15. 如何使用django-nvd3在X軸上繪製不同值的多線圖?
- 16. angularjs nvd3多梳圖表x軸刻度不顯示
- 17. 如何在nvd3角度多邊形圖表中的每個條的頂部顯示條的值?
- 18. NVD3多軸條形圖上繪製
- 19. Swift如何在地圖視圖上顯示某人的位置?
- 20. 如何在2位顯示器上顯示14位輸出?
- 21. 如何在圖像上顯示圖表的許多圖例
- 22. nvd3和angularjs多條形圖
- 23. nvd3餅圖傳說中的位置
- 24. 如何在SpreadsheetGear的不同位置顯示多個餅圖
- 25. 如何在XP樣式按鈕上顯示位圖/圖標
- 26. 如何顯示多個用戶在谷歌地圖上的當前位置android
- 27. 如何更改legend-nvd3圖形的位置
- 28. 在不同位置的圖上顯示多條垂直線
- 29. 要在地圖上顯示多個位置的JavaScripts
- 30. 如何顯示地圖上的所有標記/位置android/
感謝兄弟..但我是試圖讓這個工作在一個多條形圖上..我現在已經編輯了這個問題,明確提到這一點。 – azi 2013-04-26 12:00:05
@azi - 您是否嘗試將該行添加到多條形圖中?到目前爲止你做了什麼? – shabeer90 2013-04-26 12:02:32
是的,我沒有嘗試..沒有工作...我有多條條形圖工作生產..只是想顯示在頂部的值...沒有找到任何參考任何地方...所以天堂沒有嘗試過任何東西(除了你的建議) – azi 2013-04-26 12:12:37