Highchart - show / hide an y-Axis without hiding the series

后端 未结 4 1050
孤独总比滥情好
孤独总比滥情好 2020-12-03 10:21

I\'m working with Highchart. I\'ve got a multiple series graph in which each series have their own y-axis.

pretty much like this one (jsfiddle)

when we cli

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-03 10:46

    For newer versions (I'm using the 6.2.0), the yAxis property has a parameter called gridLineWidth. Just set it to 0 and the grids for that axis are going to disappear. In this JSFiddle there is an example of it.

    However, if you are in styled mode this it's trickier. Here, you have to set a className for the target axis and then set the CSS like this:

    .highcharts-yaxis-grid {
        &.right-axis {
          path {
            stroke: none;
          }
        }
      }
    

    For example, this will make dissapear the grids of the axis with a className set as right-axis. This allow to have different styles for the multiple axis.

提交回复
热议问题