&dataURL=headcount.xml works why not &dataURL=headcount.php?
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



&dataURL=headcount.xml works why not... Expand / Collapse
Author
Message
Posted 9/6/2007 7:34:18 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/7/2007 5:24:32 PM
Posts: 3, Visits: 6
Why can't I do this:

.... <chart stuff>

&dataURL=headcount.php

Where, headcount.php is simply a bunch of php statements that return xml data:

<?php
echo "<chart caption='Monthly Headcount' >";
echo "<set label='20070701' value='117'/>";
echo "<set label='20070801' value='123'/>";
echo "<set label='20070901' value='122'/>";
echo "</chart>";
?>

If I put this xml data into a file called 'headcount.xml' and change chart to use &dataURL=headcount.xml it works just fine. But I want the xml data to be generated dynamically.  Am I missing something here? I need a clue.

-ac

Post #2268
Posted 9/7/2007 12:38:47 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/7/2007 5:24:32 PM
Posts: 3, Visits: 6
Stumbled upon the answer myself....

First, you want to inlcude header('Content-type: text/xml'); so you can directly view the xml data in a browser.  This showed me I was missing the top level element.  So I changed headcount.php to this and it works:

<?php

echo "<chart caption='Monthly Headcount'>";

echo "<set label='20070101' value='97'/>";

echo "<set label='20070201' value='96'/>";

echo "<set label='20070301' value='103'/>";

echo "<set label='20070401' value='108'/>";

echo "<set label='20070501' value='110'/>";

echo "<set label='20070601' value='115'/>";

echo "<set label='20070701' value='117'/>";

echo "<set label='20070801' value='123'/>";

echo "<set label='20070901' value='122'/>";

echo "</chart>";

?>



-ac
Post #2285
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -7:00, Time now is 6:45pm


Execution: 0.063.