Too many data for a Column Graph...need help with Area graph
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Too many data for a Column Graph...need help... Expand / Collapse
Author
Message
Posted 3/20/2008 3:39:19 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 3/27/2008 3:14:10 PM
Posts: 2, Visits: 59
Hello, Im new to FusionCharts, I liked the tool. Here's my problem, hope you can help me.

I am pulling data from MySQL and the query result table is like this, but this are just 15 I want to graph about 1,000.
The "|" separates the columns in the table...
x1 | y1
-----------------------------------------
Tue 03/18 4:54PM | 8
Tue 03/18 4:55PM | 7
Tue 03/18 4:56PM | 7
Tue 03/18 4:57PM | 6
Tue 03/18 4:59PM | 6
Tue 03/18 5:00PM | 6
Tue 03/18 5:08PM | 5
Tue 03/18 5:09PM | 7
Tue 03/18 5:11PM | 8
Tue 03/18 5:12PM | 9
Tue 03/18 5:13PM | 10
Tue 03/18 5:15PM | 10
Wed 03/19 12:48AM | 12

I want to put the X1 on the X axis, and off course the Y1 on Y axis. I have now a graph but in Column3D, but it's not showing good since there are too many data. I want it on a MSArea graph or a Line where I dont mess with columns. Here is my code of what Im getting now on a Column3D and a picture of the chart, if you see, there are too many data in the chart it cannot be displayed well. I've searched the documentation on the MSArea and have no idea how to use it with mysql...
or tell me what's the best idea to graph more than 1,000 elements in a simple graph....

//Generate the chart element string
$strXML = "";

// Connet to the DB
$link = start_mysql();


//Now, we get the data for the TGP
$strQuery = "SELECT
DATE_FORMAT(date, '%a %m/%d %l:%i%p') AS x1, SUM(active) AS y1
FROM history
WHERE DATE_SUB(NOW(),INTERVAL 1 DAY) <= date AND tgrp = 10
GROUP BY date
ORDER BY date;";

$result = mysql_query($strQuery) or die(mysql_error());

//Iterate through each factory
if ($result) {
while($ors = mysql_fetch_array($result)) {
//Here, we convert date into a more readable form for set label.
$strXML .= "";
}
}
mysql_close($link);

//Close element
$strXML .= "";

//Create the chart - Column 2D Chart with data from strXML
echo renderChart("../../../Charts/Column3D.swf", "", $strXML, "FactoryDetailed", 900, 500, false, false);
?>


David Mendez

  Post Attachments 
chart.PNG (10 views, 124.50 KB)
Post #5190
Posted 3/26/2008 12:38:32 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Today @ 1:19:54 AM
Posts: 870, Visits: 1,386
Hi,

Could you please use Single Series Area chart Area2D.swf to suit your need?

MSArea would need more that one datasets while your data is having only one dataset.

Still if you want to use multi-series Area chart what you need to do is to put all labels in <categories> element creating <category label='yourlabels' /> elements.

For each dataset create <dataset> element inside which you would provide data using <set value='10'/>

Example of an XML for Multi-series chart (MSArea is a Multi-series Chart):

<chart>

<categories>
<category label='foo'/>
<category label='doo'/>
<category label='foo'/>
<category label='doo'/>
</cateogries>

<dataset seriesName='hits'>
<set value='10'/>
<set value='20'/>
<set value='30'/>
<set value='11'/>
</dataset>

<dataset seriesName='download'>
<set value='6'/>
<set value='12'/>
<set value='18'/>
<set value='9'/>
</dataset>

</chart>

Regards,

Sudipto Choudhury
FusionCharts Team

Post #5276
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 4:05am


Execution: 0.188.