jerrygarciuh Report post Posted November 9, 2009 (edited) Hello, PHP/mySQL professional but a FusionCharts newbie here. The XML below is what I am sending from PHP/mySQL to the chart. If I manually type subcaption='10-1-09 to 11-10-09' it shows up no problem; same for xAxisName. If I instead use subcaption='<?=$datePhrase?>' xAxisName='<?=$datePhrase?>' then they are not shown at all. If I set $datePhrase to 'xxx' it does not display. If instead of echoing $datePhrase I add xAxisName='<?="xxx"?>' and just echo an uninterpolated string it shows up. What am I doing wrong here? TIA! JG Edit: the bbcode code tags were not displaying so I am trying to replace them <chart caption='Driving Distance' subcaption='10-1-09 to 11-10-09' xAxisName='10-1-09 to 11-10-09' yAxisName='Distance' yAxisMinValue='0' numberPrefix='' showValues='1' alternateHGridColor='FCB541' alternateHGridAlpha='20' divLineColor='FCB541' divLineAlpha='50' canvasBorderColor='666666' baseFontColor='666666' lineColor='FCB541'> <set label='10/24/09' value='139' /> <set label='10/28/09' value='75' /> <set label='11/9/09' value='126' /> <set label='11/4/09' value='280' /> <styles> <definition> <style name='Anim1' type='animation' param='_xscale' start='0' duration='1' /> <style name='Anim2' type='animation' param='_alpha' start='0' duration='0.6' /> <style name='DataShadow' type='Shadow' alpha='40'/> </definition> <application> <apply toObject='DIVLINES' styles='Anim1' /> <apply toObject='HGRID' styles='Anim2' /> <apply toObject='DATALABELS' styles='DataShadow,Anim2' /> </application> </styles> </chart> Edited November 9, 2009 by Guest Share this post Link to post Share on other sites
Ayan Pal Report post Posted November 9, 2009 Hi jerrygarciuh, Could you please give the sample working php code Share this post Link to post Share on other sites
jerrygarciuh Report post Posted November 10, 2009 Thank you for your reply! Here is the code I am using. The fact that the dates are defined in the PHP is evidenced by successful changes to the date range of the displayed data. [ code ] <? include_once("../classDBI/classDBI.php"); $uObj = new User; $rObj = new Round; $uObj->userSession(); $distances = $rObj->field_by_dates($_SESSION['user']->id, 'drivingDistance_avg_per_hole', $_GET['start'], $_GET['end']); if ($_GET['start'] && $_GET['end']) { $datePhrase = date("n-j-y", strtotime($_GET['start'])) . " to " . date("n-j-y", strtotime($_GET['end'])); } ?> <chart caption='Driving Distance' subcaption='<?=$datePhrase?>' xAxisName='<?=$datePhrase?>' yAxisName='Distance' yAxisMinValue='0' numberPrefix='' showValues='1' alternateHGridColor='FCB541' alternateHGridAlpha='20' divLineColor='FCB541' divLineAlpha='50' canvasBorderColor='666666' baseFontColor='666666' lineColor='FCB541' canvasRightMargin='50' > <? if ($distances) { foreach ($distances as $k => $v) { ?> <set label='<?=date("n/j/y", strtotime($k))?>' value='<?=$v?>' /> <? }} ?> <styles> <definition> <style name='Anim1' type='animation' param='_xscale' start='0' duration='1' /> <style name='Anim2' type='animation' param='_alpha' start='0' duration='0.6' /> <style name='DataShadow' type='Shadow' alpha='40'/> </definition> <application> <apply toObject='DIVLINES' styles='Anim1' /> <apply toObject='HGRID' styles='Anim2' /> <apply toObject='DATALABELS' styles='DataShadow,Anim2' /> </application> </styles> </chart> [ /code] Share this post Link to post Share on other sites
Ayan Pal Report post Posted November 11, 2009 (edited) Hi jerrygarciuh, please add the Highlighted code in your page. [ code ] <? include_once("../classDBI/classDBI.php" [Wink] ; $uObj = new User; $rObj = new Round; $uObj->userSession(); $distances = $rObj->field_by_dates($_SESSION['user']->id, 'drivingDistance_avg_per_hole', $_GET['start'], $_GET['end']); if ($_GET['start'] && $_GET['end']) { $datePhrase = date("n-j-y", strtotime($_GET['start'])) . " to " . date("n-j-y", strtotime($_GET['end'])); } header('Content-type: text/xml'); ?> [ /code] Edited November 11, 2009 by Guest Share this post Link to post Share on other sites
jerrygarciuh Report post Posted November 11, 2009 Hi Ayan, Thank you for the reply! I have now added <? header('Content-type: text/xml'); ?> to all of my XML generation pages directly before the output of the script. This has not resolved the disappearing text. I also tried adding static text to the configuration like so: subcaption='x<?=$datePhrase?>' and the X I added shows up by itself and centered even though when the XML is viewed directly the date string is in place and correctly formatted with no illegal characters. I also tried adding ob_start() and ob_flush() at the appropriate spots hoping this would resolve it. I guess my next step will be to write the output to a static file and issue a redirect header to the static file. Have you seen this issue before? JG Share this post Link to post Share on other sites
FusionCharts Support Report post Posted January 4, 2010 Hi, Could you please cross-check whether the XML that is getting generated contains the desired text as value in those attributes? So, Instead of passing the XML (URL of the file) to the chart could you please try once loading that in the browser (firefox) and see (and share with us) what values are exactly coming? Share this post Link to post Share on other sites