【发布时间】:2017-08-04 22:10:01
【问题描述】:
我有两个使用 Chart.js 的水平条形图,它们使用相同的选项对象,但数据量不同。有没有办法让底部(“位置”)图表在条形之间的边距方面看起来像顶部(“颜色”)?
我的选项对象如下所示,我很难过:
options={{
elements: {
rectangle: {
borderSkipped: 'left',
},
},
onClick: this.chartLink,
animation: false,
legend: {
display: false,
},
tooltips: {
enabled: false,
},
maintainAspectRatio: true,
scales: {
xAxes: [{
gridLines: {
display: false,
drawBorder: false,
},
ticks: {
beginAtZero: true,
display: false,
},
}],
yAxes: [{
tabIndex: 0,
maxBarThickness: 100,
categoryPercentage: 1.0,
barPercentage: 1.0,
barThickness: 20,
gridLines: {
display: false,
drawBorder: false,
},
ticks: {
fontColor: 'black',
fontStyle: 'normal',
maxTicksLimit: 5,
paddingLeft: 20,
mirror: true,
},
}],
},
【问题讨论】:
标签: javascript charts chart.js chart.js2