macromedia.coldfusion.getting_started
[Top] [All Lists]

How to

Subject: How to
From: "Hydrowizard"
Date: Thu, 7 Feb 2008 20:36:45 +0000 UTC
Newsgroups: macromedia.coldfusion.getting_started

I have this sql which selects country_count where there are more than 5 
records. The question Is the best way I can get the other records (having 
country_count < 5) as well. I?m looking into how to do it with sql but I was 
thinking maybe I should I make another query to set this value instead which 
would be easier. Is there a way to add variables to the valuecloumn in 
chartseries?Thanks for any pointers as to the best way to look at this:    

 <cfchartseries type="pie"  query="q_countries"  
 itemcolumn="country"  valuecolumn="country_count"> 

 The code:

 <cfquery name="q_countries" datasource="mydsource"> 
 SELECT UCASE(country) AS Country, COUNT(*) AS country_count, Visit, 
 FROM clientinfo 
 where month(visit) = #url.monthnowis# 
 GROUP BY country 
 HAVING country_count > 5
 ORDER BY country_count
 </cfquery>

 <cfchart format="flash"
     chartwidth="350"
     chartheight="300"
     seriesplacement="cluster"
     title = "Visitors by Country #qrymonths.salesmonth# #qrymonths.salesyear#"
     show3d="true"
     yAxistitle="%"
     showLegend="yes">
     <cfchartseries type="pie"  query="q_countries"  
 itemcolumn="country"  valuecolumn="country_count"> 
     </cfchartseries>
  </cfchart>


<Prev in Thread] Current Thread [Next in Thread>