Note that there are some explanatory texts on larger screens.

plurals
  1. POcfchart displaying white spaces
    text
    copied!<p>I am counting response of a specific question and wants to display its response count through charts. I am using this code for counting response.</p> <pre><code>&lt;cfquery name="questions"&gt; SELECT questions.id, questions.question as question, questiontypes.name as questiontype, questiontypes.template as template, surveys.name as surveysname FROM questions LEFT JOIN answers ON questions.id = answers.fkquestionid INNER JOIN questiontypes ON questions.fkquestiontypeid = questiontypes.id INNER JOIN surveys ON questions.fksurveyid = surveys.id WHERE fksurveyid = &lt;cfqueryparam cfsqltype="cf_sql_integer" value="#arguments.surveyid#"&gt; &lt;/cfquery&gt; &lt;cfset response.question = questions&gt; &lt;cfloop query="questions"&gt; &lt;cfswitch expression ="#questions.template#"&gt; &lt;cfcase value="truefalse"&gt; &lt;cfquery name="gettotaltruefalse"&gt; SELECT COUNT( IF(result.truefalse = 1,1,NULL )) AS totaltrue, COUNT( IF(result.truefalse = 0,0,NULL )) AS totalfalse, COUNT( IF(result.truefalse = 1,1,NULL ))/COUNT(0)*100 AS trueperc, COUNT( IF(result.truefalse = 0,0,NULL ))/COUNT(0)*100 AS falseperc FROM results result WHERE fkquestionid = &lt;cfqueryparam cfsqltype="cf_sql_integer" value="#questions.id#"&gt; AND NOT ISNULL(result.truefalse) GROUP BY result.fkquestionid &lt;/cfquery&gt; &lt;cfset response.totaltruefalse = gettotaltruefalse&gt; &lt;/cfcase&gt; </code></pre> <p>I am using this code to display charts.</p> <pre><code>&lt;cfoutput query="rc.data.questions" group="id"&gt; &lt;cfchart format="flash" chartwidth="575" chartheight="575" show3d="yes"&gt; &lt;cfchartseries type="pie" paintstyle="raise" seriescolor="blue" datalabelstyle="pattern"&gt; &lt;cfchartdata item="true" value="#rc.data.totaltruefalse.totaltrue#"&gt; &lt;cfchartdata item="false" value="#rc.data.totaltruefalse.totalfalse#"&gt; &lt;/cfchartseries&gt; &lt;/cfchart&gt; &lt;/cfoutput&gt; </code></pre> <p>my problem is, it is showing white space instead of chart even i have tried this in all browsers.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload