使用php codeigniter的HTML图形
有人能帮我把html5 cnavasjs用于图形吗?图形是重复的 php代码是使用php codeigniter的HTML图形,php,mysql,Php,Mysql,有人能帮我把html5 cnavasjs用于图形吗?图形是重复的 php代码是 window.onload = function () { var chart = new CanvasJS.Chart("chartContainer", { theme: "theme2",//theme1 animationEna
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer", {
theme: "theme2",//theme1
animationEnabled: true,
zoomEnabled:true,
title:{
text: "Basic Column Chart Of Student in Current Year" ,
fontColor: "#0A89C4"
},
data: [
{
// Change type to "bar", "splineArea", "area", "spline", "pie",etc.
type: "column",
dataPoints: [
<?php foreach ($std as $row3){?>
{ label: "<?php echo $row3['obj_full_month'];?>", y: <?php echo count($row3['obj_student_id']);?> },
<?php
}
?>
]
}
]
});
chart.render();
}
您是否尝试过使用Distinct:
选择Distinct obj\U full\U MOUNT,obj\U SUSTOMENT\U id FROM…
?您有3个结果。这是预期的还是像Mahmoud所说的由sql查询引起的重复?您的数据有什么问题?你想做什么?是否要消除重复数据?或者你想把它们加起来?您可能需要计算每个月的学生人数?
SELECT * FROM `obj_organisation`,`obj_student`,`obj_student_graph`
WHERE obj_organisation.obj_org_id = obj_student.obj_org_id
AND
obj_organisation.obj_org_id = obj_student_graph.obj_org_id
AND
obj_student.obj_student_id = obj_student_graph.obj_student_id
AND
obj_student_graph.obj_org_id = '$id'
AND
obj_student_graph.obj_year = '$year'!