plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [{
name: 'Not Completed',
data: [<?php echo json_encode($TotalNotCompleted); ?>]
/* here how to write query to fetch data from database, to make my graph work dynamically */
}, {
name: 'Completed',
data: [<?php echo json_encode($TotalCompleted); ?>]
}]
答案 0 :(得分:0)
plotOptions: {
column: {
pointPadding: 0.2,
borderWidth: 0
}
},
series: [
<?
$QueryTST=mysql_query("SELECT * FROM TotalCounterSales WHERE AdminCity='$City' AND AdminStore='$StoreNo' AND SalesDate='$TodaysDate'");
while($RowQTST=mysql_fetch_array($QueryTST))
{
$ProductNo=$RowQTST['ItemNo'];
$QueryProductName=mysql_query("SELECT * FROM products WHERE PId='$ProductNo' ");
while($RowQPN=mysql_fetch_array($QueryProductName))
{
$ProductName=$RowQPN['name'];
}
?>
{ name: "<?echo $ProductName;?>", data: [<?echo $RowQTST['Quantity'];?>]},
<?}?>
]