使用堆疊面積圖所看到在這個例子中 http://nvd3.com/ghpages/stackedArea.htmld3.js&nvd3.js軸和標籤精度格式
試圖格式化y軸刻度標記標籤和工具提示標籤是整數,而不是浮。試圖從
chart.yAxis
.axisLabel('Users')
.tickFormat(d3.format(',.2f'));
改變後續代碼
chart.yAxis
.axisLabel('Users')
.tickFormat(d3.format(',.0d'));
精密保持不變(仍顯示值百位)。我跟着Github Wiki無效https://github.com/mbostock/d3/wiki/Formatting#wiki-d3_format
任何建議或提示將不勝感激。
感謝您的答案和格式化的破敗! – Viet 2012-07-26 19:03:58
其他人應該發現它有用。我在這裏用d3格式化程序製作了一個小教程:http://koaning.github.io/html/d3format.html – cantdutchthis 2014-08-22 18:27:46