【问题标题】:I was trouble with Highcharts in x-axis series name and y-axis values name i don't want this two name's?我在 x 轴系列名称和 y 轴值名称中遇到了 Highcharts 的问题,我不想要这两个名称?
【发布时间】:2017-02-09 05:45:40
【问题描述】:

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 轴禁用阀门名称

【问题讨论】:

    标签: javascript json highcharts


    【解决方案1】:

    制作图例enable:false,y轴标题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]
        }]
    });
    

    【讨论】:

    • 标题名称 X 轴标签被禁用我想要图表之外的标题名称
    • fiddle是这个根据要求
    【解决方案2】:

    您可以通过设置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]
        }]
    });
    

    【讨论】:

      猜你喜欢
      • 2013-08-29
      • 2013-08-14
      • 2021-07-29
      • 2015-03-10
      • 1970-01-01
      • 1970-01-01
      • 2021-01-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多