Search code examples
highchartsgauge

hide YAxis values in HighChart Solid Gauge


In the below example, is it possible to "hide" the Y Axis values - for example - do not show the 0 and the 200 (in the left). Looking for cleaner chart..

http://www.highcharts.com/demo/gauge-solid/dark-unica


Solution

  • By targeting the yAxis labels via CSS you can do so just fine

    CSS:

    .highcharts-axis-labels.highcharts-yaxis-labels{
        display:none;   
    }
    

    Or alternatively, via setting the showFirstLabel and showLastLabel property of the yAxis in the case of the gauge has the same effect.

    JS:

        yAxis: {
            showFirstLabel:false,
            showLastLabel:false,
            min: 0,
            max: 5,
            title: {
                text: 'RPM'
            }
        }
    

    Here is a demo showing both http://jsfiddle.net/robschmuecker/yra3mex6/ Here are the docs regarding the properties http://api.highcharts.com/highcharts#yAxis.showFirstLabel