{"id":7546,"date":"2015-07-26T05:12:39","date_gmt":"2015-07-26T05:12:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/07\/26\/multibar-chart-with-nvd3-d3-only-shows-labels-for-every-other-tick-on-the-x-axis-how-can-i-get-them-all-to-show-up-open-source-projects-novus-nvd3\/"},"modified":"2015-07-26T05:12:39","modified_gmt":"2015-07-26T05:12:39","slug":"multibar-chart-with-nvd3-d3-only-shows-labels-for-every-other-tick-on-the-x-axis-how-can-i-get-them-all-to-show-up-open-source-projects-novus-nvd3","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/07\/26\/multibar-chart-with-nvd3-d3-only-shows-labels-for-every-other-tick-on-the-x-axis-how-can-i-get-them-all-to-show-up-open-source-projects-novus-nvd3\/","title":{"rendered":"MultiBar chart with nvd3 \/ d3 only shows labels for every other tick on the x-axis. How can I get them all to show up?-open source projects novus\/nvd3"},"content":{"rendered":"<p>Data:<\/p>\n<pre><code>nvd3TestData = [\n      {\n        values:[\n          {x:\"M\",y:1},\n          {x:\"T\",y:2},\n          {x:\"W\",y:3},\n          {x:\"R\",y:3},\n          {x:\"F\",y:4},\n          {x:\"S\",y:5},\n          {x:\"U\",y:6}\n        ],\n        key:\"Apples\"\n      },\n      {\n        values:[\n          {x:\"M\",y:5},\n          {x:\"T\",y:2},\n          {x:\"W\",y:6},\n          {x:\"R\",y:8},\n          {x:\"F\",y:2},\n          {x:\"S\",y:4},\n          {x:\"U\",y:1}\n        ],\n        key:\"Zebras\"\n      }\n    ]\n<\/code><\/pre>\n<p>Creating the chart (pulled from an angularjs directive):<\/p>\n<p>nv.addGraph -&gt; chart = nv.models.multiBarChart() .stacked(true) .showControls(false)<\/p>\n<pre><code>chart.xAxis\n  .axisLabel(attrs.xAxisLabel)\n\nchart.yAxis\n  .axisLabel(attrs.yAxisLabel)\n  .tickFormat(d3.format(',r'))\n\n\nconsole.log element\n\n\nd3.select(element[0].children[0])\n  .datum(nvd3TestData)\n  .call(chart)\n\nnv.utils.windowResize(chart.update)\n<\/code><\/pre>\n<p>Output:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/Duory.png\" \/><\/p>\n<p>Expected output would have all 7 labels: M T W R F S U<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Data: nvd3TestData = [ { values:[ {x:&#8221;M&#8221;,y:1}, {x:&#8221;T&#8221;,y:2}, {x:&#8221;W&#8221;,y:3}, {x:&#8221;R&#8221;,y:3}, {x:&#8221;F&#8221;,y:4}, {x:&#8221;S&#8221;,y:5}, {x:&#8221;U&#8221;,y:6} ], key:&#8221;Apples&#8221; }, { values:[ {x:&#8221;M&#8221;,y:5}, {x:&#8221;T&#8221;,y:2}, {x:&#8221;W&#8221;,y:6}, {x:&#8221;R&#8221;,y:8}, {x:&#8221;F&#8221;,y:2}, {x:&#8221;S&#8221;,y:4}, {x:&#8221;U&#8221;,y:1} ], key:&#8221;Zebras&#8221; } ] Creating the chart (pulled from an angularjs directive): nv.addGraph -&gt; chart = nv.models.multiBarChart() .stacked(true) .showControls(false) chart.xAxis .axisLabel(attrs.xAxisLabel) chart.yAxis .axisLabel(attrs.yAxisLabel) .tickFormat(d3.format(&#8216;,r&#8217;)) console.log element d3.select(element[0].children[0]) .datum(nvd3TestData) .call(chart) nv.utils.windowResize(chart.update) [&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-7546","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7546","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=7546"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7546\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}