Hide axis and gridlines Highcharts

后端 未结 7 421
醉酒成梦
醉酒成梦 2020-12-08 06:02

I am trying to hide the axis and gridlines of my Highcharts chart entirely. So far I have tried to set the width of the lines to 0, but it didn\'t work out.

         


        
相关标签:
7条回答
  • 2020-12-08 06:23

    i managed to turn off mine with just

           lineColor: 'transparent',
           tickLength: 0
    
    0 讨论(0)
  • 2020-12-08 06:26

    you can also hide the gridline on yAxis as:

    yAxis:{ 
      gridLineWidth: 0,
      minorGridLineWidth: 0
    }
    
    0 讨论(0)
  • 2020-12-08 06:32

    For the yAxis you'll also need:

    gridLineColor: 'transparent',

    0 讨论(0)
  • 2020-12-08 06:32

    This has always worked well for me:

    yAxes: [{
             ticks: {
                     display: false;
                    },
    
    0 讨论(0)
  • 2020-12-08 06:33

    Just add

    xAxis: {
       ...  
       lineWidth: 0,
       minorGridLineWidth: 0,
       lineColor: 'transparent',
       ...          
       labels: {
           enabled: false
       },
       minorTickLength: 0,
       tickLength: 0
    }
    

    to the xAxis definition.

    Since Version 4.1.9 you can simply use the axis attribute visible:

    xAxis: {
        visible: false,
    }
    
    0 讨论(0)
  • 2020-12-08 06:47

    If you doesn't want to touch the config object, you just hide the grid by css:

    .chart-container .highcharts-grid {
       display: none;
    }
    
    0 讨论(0)
提交回复
热议问题