我在使用X轴系列名称和y轴值名称的Highcharts时遇到麻烦我不想要这两个名字吗?

时间:2017-02-09 05:45:40

标签: javascript json highcharts

HTML

  <script src="https://code.highcharts.com/highcharts.js"></script>

  <div id="container" style="height: 400px"></div>

JS

 Highcharts.chart('container', {
  title: {
    text: 'X axis labels are disabled'
},
xAxis: {

    labels: {
        enabled: false
    }
},

  series: [{
    data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, [enter link description here][1]194.1, 95.6, 54.4]
}]
 });

http://jsfiddle.net/Kondaldurgam/jfg8w3f9/

在x轴上我想在系列名称中禁用,在阀名称中禁用y轴

2 个答案:

答案 0 :(得分:0)

制作图例enable:false和yAxis标题text:''

Fiddle link

Highcharts.chart('container', {
    title: {
        text: 'X axis labels are disabled'
    },
    xAxis: {

        labels: {
            enabled: false
        }
    },
    yAxis: {

        title: {
            text: ''
        },
    },
    legend:{
        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]
    }]
});

答案 1 :(得分:0)

您可以通过设置labels:{enabled: false}title:{text:null}来删除x和y轴的标签和值。同时通过在系列showInLegend: false,中插入此图例来隐藏图表图例。

Working Fiddle

示例JS:

Highcharts.chart('container', {
    title: {
        text: 'X axis labels are disabled'
    },
    xAxis: {

        labels:{enabled: false},
        title: {
                text: null
        }
    },
    yAxis: {
    labels:{enabled: false},
     title: {
            text: null
     }
    },

    series: [{
            showInLegend: false, 
        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]
    }]
});