javascript - add y axis label to NVD3 Multi-Bar Chart - Stack Overflow

I'm trying to add axis labels to a NVD3 Multi-Bar Chart, but it only seems to work for the x axis.

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: /

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");

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/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");
Share Improve this question asked Oct 12, 2014 at 14:57 user3170702user3170702 2,0618 gold badges27 silver badges33 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744321686a4568448.html

相关推荐

  • javascript - add y axis label to NVD3 Multi-Bar Chart - Stack Overflow

    I'm trying to add axis labels to a NVD3 Multi-Bar Chart, but it only seems to work for the x axis.

    7天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信