{"id":7532,"date":"2015-07-26T05:11:15","date_gmt":"2015-07-26T05:11:15","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/07\/26\/d3-js-nvd3-js-axis-and-label-precision-formatting-open-source-projects-novus-nvd3\/"},"modified":"2015-07-26T05:11:15","modified_gmt":"2015-07-26T05:11:15","slug":"d3-js-nvd3-js-axis-and-label-precision-formatting-open-source-projects-novus-nvd3","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/07\/26\/d3-js-nvd3-js-axis-and-label-precision-formatting-open-source-projects-novus-nvd3\/","title":{"rendered":"d3.js &#038; nvd3.js axis and label precision formatting-open source projects novus\/nvd3"},"content":{"rendered":"<p>Using the stacked area chart as seen in this example http:\/\/nvd3.com\/ghpages\/stackedArea.html<\/p>\n<p>Trying to format the y-axis tick labels and the tooltip labels to be integers instead of floats. Tried changing the follow code from<\/p>\n<pre><code>chart.yAxis\n        .axisLabel('Users')\n        .tickFormat(d3.format(',.2f'));\n<\/code><\/pre>\n<p>to<\/p>\n<pre><code>chart.yAxis\n        .axisLabel('Users')\n        .tickFormat(d3.format(',.0d'));\n<\/code><\/pre>\n<p>Precision remains unchanged (still shows values to the hundredths place). I&#8217;ve followed the Github Wiki to no avail https:\/\/github.com\/mbostock\/d3\/wiki\/Formatting#wiki-d3_format<\/p>\n<p>Any suggestions or hints will be greatly appreciated.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using the stacked area chart as seen in this example http:\/\/nvd3.com\/ghpages\/stackedArea.html Trying to format the y-axis tick labels and the tooltip labels to be integers instead of floats. Tried changing the follow code from chart.yAxis .axisLabel(&#8216;Users&#8217;) .tickFormat(d3.format(&#8216;,.2f&#8217;)); to chart.yAxis .axisLabel(&#8216;Users&#8217;) .tickFormat(d3.format(&#8216;,.0d&#8217;)); Precision remains unchanged (still shows values to the hundredths place). I&#8217;ve followed the Github [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7532","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7532"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7532\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}