nonshatter Report post Posted January 17, 2011 Hi all, I've really been struggling with this... I have a nice MSLine chart on the go, all working, bloody lovely. I have added a select box at the bottom of my page which is intended to allow the user to select the date range from which to plot the new chart. However, when the chart re-loads using the new date ranges, the chart is only plotted on portion of the chart canvas. All the data that is being plotted with the new date range is definitely correct, only that the plot isn't being spread or scaled to fit the canvas. It's all being squashed over to the left hand side of the chart. I have attached the image of the squashed chart. Does this look like a chart configuration error, or a coding (PHP) error? Many thanks, ns Share this post Link to post Share on other sites
Guest Angie Report post Posted January 17, 2011 Hi, Welcome to FusionCharts Forum! Could you please send us the xml code to look into the issue? Awaiting for your reply. Share this post Link to post Share on other sites
nonshatter Report post Posted January 17, 2011 (edited) Hi there, here is the $strXML. Is there a way of printing the contents of the $strXML variable with it's subsequent values? $strXML = "<chart caption='$title' subCaption='. Test Case Progress .' yAxisName='Number of Tests' showValues='0' xAxisName='Date' paletteColors='008B00, FF0000, B23AEE, 00FFFF, FFF000, 0000FF' bgAlpha='50' canvasBgAlpha='80' anchorRadius='1' labelDisplay='AUTO' useEllipsesWhenOverflow='1'>"; $strCategories = "<categories>"; //Setup multiple serie datasets $strDataPassed = "<dataset seriesName='Passed'>"; $strDataFailed = "<dataset seriesName='Failed'>"; $strDataRetest = "<dataset seriesName='Retest'>"; $strDataDeferred = "<dataset seriesName='Deferred'>"; $strDataAttempted = "<dataset seriesName='Attempted'>"; $strDataPlanned = "<dataset seriesName='Plan'>"; //convert data items into XML. foreach ($arrData as $arSubData) { $strCategories .= "<category name='" . $arSubData[1] . "' />"; $strDataPassed .= "<set value='" . $arSubData[2] . "' />"; $strDataFailed .= "<set value='" . $arSubData[3] . "' />"; $strDataRetest .= "<set value='" . $arSubData[4] . "' />"; $strDataDeferred .= "<set value='" . $arSubData[5] . "' />"; $strDataAttempted .= "<set value='" . $arSubData[6] . "' />"; $strDataPlanned .= "<set value='" . $arSubData[7] . "' />"; } //Close <categories> element $strCategories .= "</categories>"; //Close <dataset> elements $strDataPassed .= "</dataset>"; $strDataFailed .= "</dataset>"; $strDataRetest .= "</dataset>"; $strDataDeferred .= "</dataset>"; $strDataAttempted .= "</dataset>"; $strDataPlanned .= "</dataset>"; //Assemble the entire XML now $strXML .= $strCategories . $strDataPassed . $strDataFailed . $strDataRetest . $strDataDeferred. $strDataAttempted. $strDataPlanned. "</chart>"; echo $strXML; //Generate the MS line chart using the flash file. echo renderChart("/tms/php/req3/MSLine.swf", "", $strXML, "req3$set", 800, 500, false, true); Edited January 17, 2011 by nonshatter Share this post Link to post Share on other sites
nonshatter Report post Posted January 17, 2011 (edited) Any ideas Angie?! A-ha! I've just noticed the debug window outputs this a couple of times: Error: Invalid Number specified in XML. Fusion charts can accept number in pure numerical form only. If your number formatting (thousand and decimal seperator) is different, please specify so in XML. Also do not add any currency symbols or other signs to the numbers So there must be an error in my coding somewhere. What kind of values cause this problem? Thanks ns Edited January 17, 2011 by nonshatter Share this post Link to post Share on other sites
nonshatter Report post Posted January 17, 2011 Looks like this guy has had a similar problem, but no solution is provided http://forum.fusioncharts.com/topic/6131-error-help-me/ Share this post Link to post Share on other sites
nonshatter Report post Posted January 17, 2011 I've solved this issue. It turned out that this foreach loop was populating the xml data with a load of null values. //convert data items into XML. foreach ($arrData as $arSubData) { $strCategories .= "<category name='" . $arSubData[1] . "' />"; $strDataPassed .= "<set value='" . $arSubData[2] . "' />"; $strDataFailed .= "<set value='" . $arSubData[3] . "' />"; $strDataRetest .= "<set value='" . $arSubData[4] . "' />"; $strDataDeferred .= "<set value='" . $arSubData[5] . "' />"; $strDataAttempted .= "<set value='" . $arSubData[6] . "' />"; $strDataPlanned .= "<set value='" . $arSubData[7] . "' />"; } I simply made a check to make sure the arSubData values were set before converting them to XML, but I find it strange that it was doing this in the first place... Consider this solved. Thanks Share this post Link to post Share on other sites
Guest Angie Report post Posted January 18, 2011 Hi, We are glad to know that your problem has been resolved. Keep FusionCharting! Share this post Link to post Share on other sites