 |
|
อยากรู้ว่าผมต้องแก้ตรงไหนเพิ่มบ้างครับ เพราะที่ทำออกมาเป็นกราฟแท่งเพียงสีเดียว แต่ที่ต้องการคือกราฟแท่งแบ่ง 2 สีตามเดือน(1เดือนมี1แท่งแต่มีสองสี) เพราะผมจะแบ่งว่าเป็นเรื่องที่ทำแล้วกับยังไม่ทำในแต่ละเดือน
Code (PHP)
<script src="report_rm/highcharts.js"></script>
<script src="report_rm/exporting.js"></script>
<script type="text/javascript">
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column'
},
title: {
text: 'จำนวนความเสี่ยงแยกตามหมวดความเสี่ยง<?php if($take_date1=='' and $mng_status==''){ echo "แสดงทั้งหมด";
} else{ echo "<br>ตั้งแต่วันที่ ".DateThai1($take_date1).''."ถึงวันที่ ".DateThai2($take_date2); } ?> '
},
subtitle: {
text: ''
},
xAxis: {
categories: [<? echo $name; ?>
],
labels: {
rotation: -45,
align: 'right',
style: {
fontSize: '13px',
fontFamily: 'Verdana, sans-serif'
}
}
},
yAxis: {
min: 0,
title: {
text: 'จำนวนเรื่อง',
align: 'high'
},
labels: {
overflow: 'justify'
}
},
tooltip: {
formatter: function() {
return '<b>'+ this.x +'</b><br/>'+
'หมวดความเสี่ยงนี้จำนวน: '+ Highcharts.numberFormat(this.y, 0) +
' เรื่อง';
}
},
plotOptions: {
bar: {
dataLabels: {
enabled: true
}
}
},
/*
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -100,
y: 0,
floating: true,
borderWidth: 1,
backgroundColor: '#FFFFFF',
shadow: true
},
*/
credits: {
enabled: false
},
series: [{
name: 'หมวดความเสี่ยง',
data: [<? echo $countnum; ?>],
dataLabels: {
enabled: true,
rotation: 0,
color: '#FFFFFF',
align: 'right',
x: 0,
y: 18,
style: {
fontSize: '13px',
fontFamily: 'Verdana, sans-serif'
}
}
}]
});
});
});
</script>
Tag : PHP, MySQL, jQuery
|
ประวัติการแก้ไข 2017-04-05 14:52:25
|
 |
 |
 |
 |
Date :
2017-04-05 14:48:55 |
By :
bakaman |
View :
1447 |
Reply :
10 |
|
 |
 |
 |
 |
|
|
|
 |