Tuan Nguyen
Tuan Nguyen

Reputation: 53

Cannot hide x axis in highchart

Demo jsfiddle

$(function () {
    $('#container').highcharts({
        chart: {
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
        },
        yAxis: {
            gridLineColor: '#197F07',
            gridLineWidth: 0,
            lineWidth:1,
             plotLines: [{
                color: '#FF0000',
                width: 1,
                value: 0
            }]
        },

        series: [{
            data: [-2,1,2,3,-3,2,1]        
        }]
    });
});

Hi, I'm working on highchart (line). I want to hide x axis, only horizontal line at 0 At above chart, I want a horizontal line at 0 only, not at -4

Is there a way to do that?

Upvotes: 0

Views: 70

Answers (1)

Edgar Villegas Alvarado
Edgar Villegas Alvarado

Reputation: 18344

Add this to your x-axis config:

labels: {
    enabled: false
},
minorTickLength: 0,
tickLength: 0,
lineColor: 'transparent'

Here you have it working: http://jsfiddle.net/edgarinvillegas/ssQVJ/8/

Upvotes: 1

Related Questions