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>