2017-10-19 64 views
1

我正在使用highcharts来创建一个图。我能够显示输出,但我无法删除标签。我无法弄清楚如何摆脱标签。如何摆脱highchart中的线条标签?

//document.getElementById('container').style.visibility='visible'; 
 
    Highcharts.chart('container', { 
 
     chart: { 
 
      type: 'area' 
 
     }, 
 
     title: { 
 
      text: 'Stock Price', 
 
     }, 
 
     subtitle: { 
 
      text: '<a style=\"color:blue;\" href=\"https://www.alphavantage.co\">Source: Alpha Vantage</a>' 
 
     }, 
 
     xAxis: { 
 
     type: 'datetime', 
 
     showLastLabel: true, 
 
     endOnTick: true, 
 
      categories: [ "05/30", "05/31", "06/01", "06/02", "06/05", "06/06", "06/07", "06/08"], 
 
       labels:{ 
 
       step:2}, 
 
       
 
       
 
     }, 
 
     yAxis: [{ 
 
      title: { 
 
       text: 'Stock Price' 
 
      }, 
 
      labels: { 
 
      enabled: false 
 
     }, 
 
      
 
      },{ 
 
      title: { 
 
       text: 'Volume ', 
 
       }, 
 
      labels: { 
 
       format: '{value}m', 
 
       enabled: false, 
 
      }, 
 
      opposite:true, 
 
      
 
     }], 
 
     plotOptions: { 
 
     labels: { 
 
      enabled: false, 
 
     }, 
 
     
 
      line: { 
 
       
 
       enableMouseTracking: false 
 
      }, 
 
       series: { 
 
      marker: { 
 
        enabled: false 
 
       },} 
 
      
 
     }, 
 
     legend: { 
 
      layout: 'vertical', 
 
      align: 'right', 
 
      verticalAlign: 'middle' 
 
     }, 
 
     series: [{ 
 
     labels: { 
 
      enabled: false, 
 
     }, 
 
      name: 'Tokyo', 
 
      type: 'area', 
 
      color: '#F66464', 
 
      
 
      
 
      data: [4,5,6,7,8,9,1], 
 
       
 
     }, { 
 
      name: 'London', 
 
      type: 'column', 
 
      color: '#FFFFFF', 
 
      yAxis: 1, 
 
      data: [1,2,3], 
 
      
 
    
 
     }] 
 
    });
<!DOCTYPE html> 
 
    <html> 
 
    <body> 
 
    <script src="https://code.highcharts.com/highcharts.js"></script> 
 
    <script src="https://code.highcharts.com/modules/series-label.js"></script> 
 
    <script src="https://code.highcharts.com/modules/exporting.js"></script> 
 
    
 
    <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div> 
 
    
 
    </body> 
 
    </html>

我尝试禁用标签,但它似乎并没有工作。 我想在下面的输出中删除标签(以白色写成的“东京”)。 enter image description here

回答