NVD3 (D3 JS) how to remove y2 axis

后端 未结 2 548
死守一世寂寞
死守一世寂寞 2020-12-21 06:54

I\'m trying to use the following example which is a line and bar chart combined.

NVD3 Line & Bar Chart combination

The problem I have is that I want the

相关标签:
2条回答
  • 2020-12-21 07:04

    Much like Lars' answer, this leaves a gap where the axis used to be, but I hid this with CSS.

    .y2-axis {display: none}
    
    0 讨论(0)
  • 2020-12-21 07:05

    There's no option to disable the second y axis. What you can do is set it up to have the same scale as the y1 axis and then remove it after creating the graph, i.e.

    d3.select('.nv-y2.nv-axis').remove();
    

    This will leave some empty space where the axis used to be, but at least it'll create the impression that there's only one y axis.

    0 讨论(0)
提交回复
热议问题