使用堆叠面积图所看到在这个例子中 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