最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Disabling HighCharts labels - Stack Overflow

programmeradmin1浏览0评论

I'm using Highcharts and I want to turn off all the labels. I made my own graph that has its own title and data axes. How do I make the ones provided by Highcharts invisible?

At the moment, I just need to get rid of the y axis marks but I'm not certain how.

Here's what I have so far:

    $('#container').highcharts({
    chart: {
        type: 'area',
        backgroundColor: 'transparent'
    },

    title: {
        text: ' '
    },
    credits: {
        enabled: false
    },
    xAxis: {
        categories: [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']
    },
    series: [{
        name: 'Rich',
        color: '#FF0000',
        data: []
    }, {
        name: 'Poor',
        data: []
    }]
});
}

I'm using Highcharts and I want to turn off all the labels. I made my own graph that has its own title and data axes. How do I make the ones provided by Highcharts invisible?

At the moment, I just need to get rid of the y axis marks but I'm not certain how.

Here's what I have so far:

    $('#container').highcharts({
    chart: {
        type: 'area',
        backgroundColor: 'transparent'
    },

    title: {
        text: ' '
    },
    credits: {
        enabled: false
    },
    xAxis: {
        categories: [' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ']
    },
    series: [{
        name: 'Rich',
        color: '#FF0000',
        data: []
    }, {
        name: 'Poor',
        data: []
    }]
});
}
Share Improve this question edited Sep 5, 2013 at 15:32 rink.attendant.6 46.4k64 gold badges110 silver badges157 bronze badges asked Sep 5, 2013 at 14:52 seamlessTLseamlessTL 691 gold badge3 silver badges7 bronze badges 1
  • {tooltip:{enabled:false}}? – Brad Christie Commented Sep 5, 2013 at 14:56
Add a ment  | 

1 Answer 1

Reset to default 6

Highcharts has fabulous documentation with fiddle examples for most stuff: http://api.highcharts./highcharts

http://jsfiddle/fnHzg/

$('#container').highcharts({
    chart: {
    },
    title : {
        text: null
    },
    xAxis: {

        title: {
            enabled: false
        }
    },
    yAxis: {

        title: {
            enabled: false
        }
    },
    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]        
    }]
});

To also turn off the yAxis and xAxis labels and tick marks:

xAxis: {

    title: {
        enabled: false
    },
    labels: {
        enabled: false
    },
    tickLength: 0
},
yAxis: {

    title: {
        enabled: false
    },
    labels: {
        enabled: false
    },
    tickLength: 0
},
发布评论

评论列表(0)

  1. 暂无评论