任何人都可以幫助我嗎?有沒有什麼方法可以使用數據庫中存儲的數據製作圖表?將它們鏈接並生成圖表我的儀表板?html - php - 數據庫phpmyadmin - 圖表/圖表
請賜教我如何做到這一點。
代碼無關與問題
echo"</br>";
echo "<b><u>Total Profit earned </u></b>" ;
echo"</br>";
$query1 = "SELECT country, SUM(profit) FROM `table 1` GROUP BY country";
$result1 = mysql_query($query1) or die(mysql_error());
while($row = mysql_fetch_array($result1)){
echo "". $row['country']. " = RM ". $row['SUM(profit)'];
echo "<br />";
}
echo"</td>";
echo"<td width='60%'>";
echo "</br>";
echo "<table border=2 align=center> ";
echo "<tr>";
echo "<td colspan=15 align='middle'><h3> Historical Data from Quarter 1 2012 until Quarter 3 2014</h3></td>";
echo "</tr>";
echo "<tr>";
echo "<td align='middle'><b>No</b></td>";
echo "<td align='middle'><b>Retailer Country</b></td>";
echo "<td align='middle'><b>Method Type</b></td>";
echo "<td align='middle'><b>Type</b></td>";
echo "<td align='middle'><b>Product Line</b></td>";
echo "<td align='middle'><b>Product Type</b></td>";
echo "<td align='middle'><b>Year</b></td>";
echo "<td align='middle'><b>Quarter</b></td>";
echo "<td align='middle'><b>Revenue</b></td>";
echo "<td align='middle'><b>Quantity</b></td>";
echo "<td align='middle'><b>Gross Margin</b></td>";
echo "</tr>";
$series = 1;
while($HData=mysql_fetch_array($query))
{
$Country=$HData['Country'];
$Method=$HData['Method'];
$Type=$HData['Type'];
$PLine=$HData['PLine'];
$PType=$HData['PType'];
$Year=$HData['Year'];
$Quarter=$HData['Quarter'];
$Revenue=$HData['Revenue'];
$Quantity=$HData['Quantity'];
$GMargin=$HData['GMargin'];
echo "<tr>";
echo "<td align='middle'>$series</td>";
echo "<td align='middle'>$Country</td>";
echo "<td align='middle'>$Method</td>";
echo "<td align='middle'>$Type</td>";
echo "<td align='middle'>$PLine</td>";
echo "<td align='middle'>$PType</td>";
echo "<td align='middle'>$Year</td>";
echo "<td align='middle'>$Quarter</td>";
echo "<td align='middle'>$Revenue</td>";
echo "<td align='middle'>$Quantity</td>";
echo "<td align='middle'>$GMargin </td>";
echo "</tr>";
$series++;
}
回聲 「」;
如果數據可用於前端通過PHP,您可以通過使用HTML5畫布 –