FusionCharts Forum: record set setup - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

record set setup line chart for wordpress

#1 User is offline   Mikebo2010 

  • Forum Newbie
  • Group: Members
  • Posts: 5
  • Joined: 09-August 10

Posted 23 August 2010 - 08:01 AM

Dear.

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-04155.00
2010-08-02 222.00
2010-08-01180.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>&nbsp;</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..:)

0

Other Replies To This Topic

#2 User is offline   shamasis 

  • Red Flavoured
  • Group: Administrators
  • Posts: 179
  • Joined: 27-October 08
  • LocationKolkata, India

Posted 07 December 2010 - 02:01 PM

You need to configure ignoreRows and ignoreColumns in order to skip the empty cells. Refer the documentation at http://www.fusioncha...om/jquery/docs/
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic