2017-06-05 29 views
0

我有一個簡單的條形圖,我無法獲得以實際列爲中心的x軸標籤。鏈接到screen shot here。任何幫助將不勝感激。無法使用Chartist.js將X軸標籤居中

<div class="ct-chart" id="chart"></div> 
    <script> 
    new Chartist.Bar('#chart', { 
     labels: ['Saved', 'Goal'], 
     series: [ 
     [6000, 10000] 
     ] 
    }, { 
     stackBars: true, 
     width: 300, 
     height: 250, 
     axisX: { 
     textAnchor: 'middle' 
     },    
     axisY: { 
     labelInterpolationFnc: function(value) { 
      return (value/1000) + 'k'; 
     } 
     } 
    }).on('draw', function(data) { 
     if(data.type === 'bar') { 

     data.element.attr({ 
      style: 'stroke-width: 70px' 
     }); 

     } 
    }); 
    </script>       

回答

0

這不是Chrome的問題,所以除非有人知道如何讓它在IE中工作,否則我會關閉這個問題。