2013-06-13 24 views
0

下面是顯示高圖的代碼小提琴。當圖表類型爲列時,它不顯示數據標籤。當它是'酒吧'它顯示數據標籤。Hightcharts - 當圖表類型爲列時,不顯示列數據標籤

http://jsfiddle.net/LuxRK/embedded/result/

$(function() { 
    $('#container').highcharts({ 
     chart: { 
      type: 'bar' 
     }, 
     title: { 
      text: 'Historic World Population by Region' 
     }, 
     subtitle: { 
      text: 'Source: Wikipedia.org' 
     }, 
     xAxis: { 
      categories: ['Nominated', 'Approved','Rejected', 'Pending'] 

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

     }, 

     plotOptions: { 
      bar: { 
       dataLabels: { 
        enabled: true 
       } 
      } 
     }, 


     series: [{ 
      name: 'Employment', 
      data: [107, 31, 635, 203] 
     }, { 
      name: 'Internship', 
      data: [973, 914, 4054, 732] 
     }] 
    }); 
}); 

有什麼我很想念?當你從「酒吧」到「列」,同一類型變更

回答

3

是在plotOptions做也改變「酒吧」到「列」如下圖所示

$(function() { 
     $('#container').highcharts({ 
      chart: { 
       type: 'column' 
      }, 
      title: { 
       text: 'Historic World Population by Region' 
      }, 
      subtitle: { 
       text: 'Source: Wikipedia.org' 
      }, 
      xAxis: { 
       categories: ['Nominated', 'Approved','Rejected', 'Pending'] 

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

      }, 

      plotOptions: { 
       column: { 
        dataLabels: { 
         enabled: true 
        } 
       } 
      }, 


      series: [{ 
       name: 'Employment', 
       data: [107, 31, 635, 203] 
      }, { 
       name: 'Internship', 
       data: [973, 914, 4054, 732] 
      }] 
     }); 
    }); 

在更新你的小提琴http://jsfiddle.net/LuxRK/1/

相關問題