user3170702
user3170702

Reputation: 2061

add y axis label to NVD3 Multi-Bar Chart

I'm trying to add axis labels to a NVD3 Multi-Bar Chart, but it only seems to work for the x axis. Is there any way around this?

I have set up an example here: http://jsfiddle.net/msts1jha/2/

var chart = nv.models.multiBarChart();

chart.xAxis
    .tickFormat(d3.format(',f'));

chart.yAxis
    .tickFormat(d3.format(',.1f'));

chart.xAxis.axisLabel("x axis");
chart.yAxis.axisLabel("y axis");

Upvotes: 5

Views: 5546

Answers (1)

shabeer90
shabeer90

Reputation: 5151

Your yAxis is hidden, set the left margin on your chart, and it will work.

Try this :

var chart = nv.models.multiBarChart().margin({left: 100});

More info regarding margins have a look here

Hope it helps

Upvotes: 6

Related Questions