Sign in to follow this  
elmome

Error in loading data

Recommended Posts

I am using coldfusion to create the fusion chart. When generate XML using encodeDataURL, I encounter "Error in Loading Data". But working fine with XML generated on the same page. What could be the cause? Pls help...

Share this post


Link to post
Share on other sites

this code working...

<cfset strEmployeeXML = "<chart caption='Sales Per Category For #intYear#' palette='1' animation='1' decimals='2' baseFontSize='11' isSliced='0' useSameSlantAngle='0' isHollow='0' labelDistance='10'>">

<cfset strEmployeeXML = "#strEmployeeXML##getSaleAllCatXML(intYear,5,true,true)#">

 <cfset strEmployeeXML = "#strEmployeeXML#<styles><definition><style type='font' name='CaptionFont' color='#captionFontColor#' size='15' /><style type='font' name='SubCaptionFont' bold='0' /></definition><application><apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /></application></styles>">

<cfset strEmployeeXML = "#strEmployeeXML#</chart>">

 <cfoutput>#renderChart("FusionCharts/Funnel.swf", "", strEmployeeXML , "TopEmployees", 400, 350, false, true)#</cfoutput>

________________________________________________________________

this is not working..

<cfset strCatChartDataURL = encodeDataURL("Year_sales_data.cfm?year=" & intYear,1)>

<cfoutput>#renderChart("FusionCharts/Funnel.swf", strCatChartDataURL, "", "TopEmployees", 400, 350, false, true)#</cfoutput>  

_____________________________________________________

Year_sales_data.cfm

<cfsilent>

 <cfset intYear = URL.year>

  <cfset strXML = "<chart caption='Sales Per Category For #intYear#' palette='1' animation='1' decimals='2' baseFontSize='11' isSliced='0' useSameSlantAngle='0' isHollow='0' labelDistance='10'>">

  <cfset strXML = "#strXML##getSaleAllCatXML(intYear,5,true,false)#">

  <cfset strXML = "#strXML#<styles><definition><style type='font' name='CaptionFont' color='#captionFontColor#' size='15' /><style type='font' name='SubCaptionFont' bold='0' /></definition><application><apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /></application></styles>">

  <cfset strXML = "#strXML#</chart>">

</cfsilent><cfoutput>#strXML#</cfoutput>

Share this post


Link to post
Share on other sites

hi,

 could you please run Year_sales_data.cfm?year=1994 in your web browser, just to ensure that your xml is properly formatted. If xml data is ok then run it with in Chart as dataURL.

Share this post


Link to post
Share on other sites

Hi,

Thanks for ur respond. I tried to run Year_sales_data.cfm?year=2008 in my browser. and the xml data is as follows:

<chart caption='Sales Per Category For 2008' palette='1' animation='1' decimals='2' baseFontSize='11' isSliced='0' useSameSlantAngle='0' isHollow='0' labelDistance='10'>

<set label='Total Sales' value='85139'/>

<set label='PHARMACY MEDICATION' value='99' isSliced='1'/>

<set label='MM ITEMS' value='973' isSliced='1'/>

<set label='OPD-CONSULT' value='290' isSliced='1'/>

<set label='IPD ROOM CHARGES' value='16111' isSliced='1'/>

<set label='IPD-CONSULT' value='53892' isSliced='1'/>

<set label='IPD NURSING CARE' value='4495' isSliced='1'/>

<set label='LABORATORY TESTS' value='1444' isSliced='1'/>

<set label='MISCELLANEOUS FEES' value='829' isSliced='1'/>

<set label='XRAY SERVICES' value='405' isSliced='1'/>

<set label='COMBO' value='6141' isSliced='1'/>'

<set label='PROCEDURE SERVICES ' value='460' isSliced='1'/>

<styles><definition><style type='font' name='CaptionFont' color='666666' size='15' />

<style type='font' name='SubCaptionFont' bold='0' /></definition><application>

<apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /></application></styles></chart>

It seems fine to me... But i still get invalid xml...

Please kindly help again... thanks!!!

Share this post


Link to post
Share on other sites

Hi

 There is a problem on your xml. one extra ( ' )  there. Please correct it and again run it

  <chart caption='Sales Per Category For 2008' palette='1' animation='1' decimals='2' baseFontSize='11' isSliced='0' useSameSlantAngle='0' isHollow='0' labelDistance='10'>

<set label='Total Sales' value='85139'/>

<set label='PHARMACY MEDICATION' value='99' isSliced='1'/>

<set label='MM ITEMS' value='973' isSliced='1'/>

<set label='OPD-CONSULT' value='290' isSliced='1'/>

<set label='IPD ROOM CHARGES' value='16111' isSliced='1'/>

<set label='IPD-CONSULT' value='53892' isSliced='1'/>

<set label='IPD NURSING CARE' value='4495' isSliced='1'/>

<set label='LABORATORY TESTS' value='1444' isSliced='1'/>

<set label='MISCELLANEOUS FEES' value='829' isSliced='1'/>

<set label='XRAY SERVICES' value='405' isSliced='1'/>

<set label='COMBO' value='6141' isSliced='1'/>'

<set label='PROCEDURE SERVICES ' value='460' isSliced='1'/>

<styles><definition><style type='font' name='CaptionFont' color='666666' size='15' />

<style type='font' name='SubCaptionFont' bold='0' /></definition><application>

<apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /></application></styles></chart>

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
Sign in to follow this