Add y-axis label to NVD3 Multi-Bar Chart

I am trying to add axis labels to the Multi-Bar diagram of an NVD3 diagram, but it only works for the x axis. Is there any way around this?

Here I gave an example: 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"); 
+5
source share
1 answer

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

Try the following:

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

Additional margin information is available here.

Hope this helps

+5
source

Source: https://habr.com/ru/post/1204511/


All Articles