I'm just trying to create a line chart with data from a db, and placing that in wordpress. im stuck setting up the right repeat region and x-y axis.
data from db.
1ekolom = date second column=avarage. ( this comes out of the mysql).
| 2010-08-04 | 155.00 | ||||||
| 2010-08-02 | 222.00 | ||||||
| 2010-08-01 | 180.00 |
php code
mysql_select_db($database_********, $********);
$query_grafiek_huis = "SELECT baan, wp_users.ID, wp_users.display_name, pss.id, pss.date, ifnull(pss.game1,0) as game1, ifnull(pss.game2,0) as game2, ifnull(pss.game3,0) as game3, ifnull(pss.game4,0) as game4, sum(ifnull(pss.game1,0)+ifnull(pss.game2,0)+ifnull(pss.game3,0)+ifnull(pss.game4,0))as 'Totaal', round(sum(ifnull(pss.game1,0)+ifnull(pss.game2,0)+ifnull(pss.game3,0)+ifnull(pss.game4,0))/(count(pss.game1)+count(pss.game2)+count(pss.
game3)+count(pss.game4)),2) AS 'avarage' FROM wp_users,pss WHERE wp_users.ID=1 and pss.id=1 and score_id=1 GROUP BY recno ORDER BY pss.date DESC ";
$grafiek_huis = mysql_query($query_grafiek_huis, $connbowling) or die(mysql_error());
$row_grafiek_huis = mysql_fetch_assoc($grafiek_huis);
$totalRows_grafiek_huis = mysql_num_rows($grafiek_huis);
HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>hello</title>
<script type="text/javascript" src="../FusionChartsFree/JS/jquery-1.4.2.js"></script>
<script type="text/javascript" src="../FusionChartsFree/JS/jquery.fusioncharts.js"></script>
<style type="text/css">
</head>
<body leftmargin="-20" topmargin="0">
<center>
<div id="myChartContainer" align="center">Loading FusionCharts!</div>
<table id="huis" border="1" align="center">
<tr> <th> </th> <th><?php do { ?>
<?php echo $row_grafiek_huis['date']; ?></th><th>
<?php } while ($row_grafiek_huis = mysql_fetch_assoc($grafiek_huis)); ?></th>
</tr>
<tr> <td>Product 1</td> <td>
<?php do { ?>
<?php echo $row_grafiek_huis['gemiddelde']; ?>
<?php } while ($row_grafiek_huis = mysql_fetch_assoc($grafiek_huis)); ?></td>
</tr>
</table>
<script type="text/javascript">
$('#huis').convertToFusionCharts({
swfPath: "/FusionChartsFree/Charts/",
type: "Column3d",
data: "#huis",
dataFormat:"HTMLTable"
});
</script>
</center>
by this i used a column3d as the line does not work. at the moment the date is showing 1 date and no avarage...
hope someone can help me out..

Back to top
MultiQuote