我創建Highcharts條形圖並將其存儲在列col-MD-12使用自舉,我設置此圖表的寬度,使得它是100%,但它的寬度甚至超過COL-MD-12。如何製作響應式高圖?
這裏是我的代碼:
<div class="col-md-12">
<div id="kanwil-report-kepuasan" style="width: 100%; min-height: 330px; margin: 0 auto"></div>
</div>
和Highcharts代碼:
$('#kanwil-report-kepuasan').highcharts({
chart: {
type: 'column'
},
colors: ['#3498DB'],
title: {
text: 'Index Kepuasan Nasabah Berdasarkan Kanwil'
},
xAxis: {
type: 'category',
title: {
text: ' '
}
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true
}
}
},
yAxis: {
// tickPositioner: function() {
// return [0,10];
// },
gridLineWidth: 0,
title: {
text: 'Persentase'
}
},
credits:{
enabled:false
},
series: [{
name: 'Score',
colorByPoint: true,
data: {!! json_encode($kanwil_index_data_kepuasan,JSON_NUMERIC_CHECK) !!}
}]
});