【发布时间】:2018-08-06 14:11:03
【问题描述】:
我正在使用 Primeng 4.1,想知道如何设置宽度,以便图表占据行的整个宽度。当我设置 width="100%" 时,它不起作用。谁能帮忙设置一下,让它是 100% 的宽度?
html
<div class="ui-g" style="padding-bottom:10px;">
<p-panel header="Movement per case" class="ui-g-12 ui-g-nopad barChartPanel">
<p-chart type="line" [data]="data" [options]="options" width="600" height="400"></p-chart>
</p-panel>
</div>
js
this.options = {
legend: {
labels: {
fontColor: 'white'
}
},
scales: {
xAxes: [{
gridLines: {
color: '#373737'
},
ticks: {
fontColor: '#fff'
}
}],
yAxes: [{
gridLines: {
color: '#373737'
},
ticks: {
fontColor: '#fff'
}
}]
},
maintainAspectRatio: false,
responsive: false,
};
【问题讨论】: