Walgermo

Problem With Zoomline Chart

Recommended Posts

Hi

 

I cant get data from dataset in while loop

 


$strXML = "<chart caption='" . ucf(translate('bodyweight')) . "' subCaption='" . ucf(translate('for')) . " " . getNameFromId($USER_PROFILE->getId()) . "' showBorder='1' formatNumberScale='0' numberSuffix='". $w_metric ."' baseFont='Arial' exportEnabled='1' exportAtClient='0' exportHandler='Charts/ExportHandlers/PHP/FCExporter.php' exportAction='download' exportTargetWindow='_blank' exportFileName='" . ucf(translate('bodyweight')) . "'>";

if($i <= $num)
{ 

	$strXML .= "<categories>";
	while($row = mysql_fetch_array($result)) 
	{
		if($w_metric == "kg")
			{
		     $strXML .= "<category label='" . formatDate($row['date'], $dateformat) . "' />";
			}
			else
			{
			$strXML .= "<category label='" . formatDate($row['date'], $dateformat) . "' />";
			}
	}
	$strXML .= "</categories>";

	$strXML .= "<dataset seriesName='Bw'>";
	while($row2 = mysql_fetch_array($result)) 
	{
		if($w_metric == "kg")
			{
		     $strXML .= "<set value='" . $row['bodyweight'] . "' />";
			}
			else
			{
			$strXML .= "<set value='" . r_nr(calcFromKg($row['bodyweight'])) . "' />";
			}
	}
	$strXML .= "</dataset></chart>";


	echo renderChart("Charts/ZoomLine.swf", "", $strXML, "".ucf(translate('bodyweight'))."", 900, 400, 1, 1);


 

 

 

The FusionChart debug shows this:


Info: Chart loaded and initialized.
Initial Width: 900
Initial Height: 400
Scale Mode: noScale
Debug Mode: Yes
Application Message Language: EN
Version: 3.2.1
Chart Type: Zoom Line Chart
Chart Objects: 
BACKGROUND
CANVAS
CAPTION
SUBCAPTION
YAXISNAME
XAXISNAME
DIVLINES
YAXISVALUES
DATALABELS
DATAVALUES
TRENDLINES
TRENDVALUES
DATAPLOT
ANCHORS
TOOLTIP
LEGEND
SCROLLBAR
OVERLAYLABEL
ENABLEDBUTTON
DISABLEDBUTTON
DATATOOLTIP
VTRENDLINES
VTRENDVALUES

INFO: Chart registered with external script. DOM Id of chart is Kroppsvekt
INFO: XML Data provided using dataXML method.
XML Data: <chart caption="Kroppsvekt" subCaption="For Stian Walgermo" showBorder="1" formatNumberScale="0" numberSuffix="lbs" baseFont="Arial" exportEnabled="1" exportAtClient="0" exportHandler="Charts/ExportHandlers/PHP/FCExporter.php" exportAction="download" exportTargetWindow="_blank" exportFileName="Kroppsvekt"><categories><category label="14.09.2010" /><category label="14.10.2010" /><category label="01.01.2011" /><category label="01.01.2011" /><category label="08.01.2011" /><category label="08.01.2011" /><category label="08.01.2011" /><category label="14.01.2011" /><category label="15.01.2011" /><category label="22.01.2011" /><category label="22.01.2011" /><category label="22.01.2011" /><category label="22.01.2011" /><category label="22.01.2011" /><category label="22.01.2011" /><category label="22.01.2011" /><category label="22.01.2011" /><category label="22.01.2011" /><category label="22.01.2011" /><category label="28.01.2011" /><category label="28.01.2011" /><category label="28.01.2011" /><category label="28.01.2011" /><category label="28.01.2011" /><category label="31.01.2011" /><category label="31.01.2011" /><category label="31.01.2011" /><category label="04.02.2011" /><category label="04.02.2011" /><category label="04.02.2011" /><category label="04.02.2011" /><category label="04.02.2011" /><category label="04.02.2011" /><category label="04.02.2011" /><category label="04.02.2011" /><category label="04.02.2011" /><category label="04.02.2011" /><category label="08.02.2011" /><category label="08.02.2011" /><category label="08.02.2011" /><category label="08.02.2011" /><category label="08.02.2011" /><category label="09.02.2011" /><category label="09.02.2011" /><category label="09.02.2011" /><category label="09.02.2011" /><category label="09.02.2011" /><category label="09.02.2011" /><category label="10.02.2011" /><category label="10.02.2011" /><category label="10.02.2011" /><category label="10.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="11.02.2011" /><category label="12.02.2011" /><category label="12.02.2011" /><category label="12.02.2011" /><category label="12.02.2011" /><category label="12.02.2011" /><category label="12.02.2011" /><category label="13.02.2011" /><category label="13.02.2011" /><category label="13.02.2011" /><category label="13.02.2011" /><category label="13.02.2011" /><category label="13.02.2011" /><category label="14.02.2011" /><category label="15.02.2011" /><category label="15.02.2011" /><category label="15.02.2011" /><category label="15.02.2011" /><category label="21.02.2011" /><category label="21.02.2011" /><category label="21.02.2011" /><category label="21.02.2011" /><category label="21.02.2011" /><category label="21.02.2011" /><category label="21.02.2011" /><category label="21.02.2011" /><category label="21.02.2011" /><category label="21.02.2011" /><category label="21.02.2011" /><category label="21.02.2011" /></categories><dataset seriesName="Bw" /></chart>

 

It doesnt get any from the second while loop.. why? :)

Share this post


Link to post
Share on other sites

Hi,

It shows that in your looping condition for the data value is not adding any set.

To trace this issue you may echo the values generating inside the loop->if/else block then you will able to get the situation what is exact flow of the program.

also echo the final $strXML inside any text-area of the page so that you will fiend the final XML generated by your php code.

If the XML generating in the code is fine then please revert back with XML from the php code

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now