to get it working though I have to move the pages into the running
config. I went with a slightly different solution than the one
proposed by others and thought I would add it to this thread incase it
is of any value to others.
Rather than handle the query in the application I used a series of
selects by the ranges I wanted and unioned them together. Below is what
I did. Not sure if it is what I am supposed to do but seemed to make
sense and made things easier to build the href back the base page to
re-filter the query.
<!--- Some Catch block for the URL variables I am expecting to catch
--->
<cfif IsDefined("URL.Chart") AND url.Chart EQ "1">
<cfset ChartMe="Region">
<cfset Title="Regional Distribution of Hikes">
</cfif>
<cfif IsDefined("URL.Chart") AND url.Chart EQ "2">
<cfset ChartMe="HikeDifficulty">
<cfset Title="Difficulty PieChart">
</cfif>
<cfif IsDefined("URL.Chart") AND url.Chart EQ "3">
<cfset ChartMe="Reccomend">
<cfset Title="Reccomendation Piechart">
</cfif>
<cfif IsDefined("URL.Chart") AND url.Chart EQ "4">
<cfset ChartMe="HikeTime">
<cfset Title="Round Trip Time In Hours PieChart">
</cfif>
<cfif IsDefined("URL.Chart") AND url.Chart EQ "5">
<cfset ChartMe="RoundTripDistance">
<cfset Title="Round Trip Distance In Miles PieChart">
</cfif>
<cfif IsDefined("URL.Chart") AND url.Chart EQ "6">
<cfset ChartMe="ElevationGain">
<cfset Title="Elevation Gained In Feet PieChart">
</cfif>
<cfif IsDefined("URL.Chart") AND url.Chart EQ "7">
<cfset ChartMe="HighPoint">
<cfset Title="Peak Elevation Gained In Feet PieChart">
</cfif>
<cfif IsDefined("URL.Chart") AND url.Chart EQ "8">
<cfset ChartMe="LowPoint">
<cfset Title="Begining Elevation In Feet PieChart">
</cfif>
<!--- End Catch block for URL variables --->
<cfif IsDefined("URL.Chart") AND url.Chart EQ "6" or url.Chart EQ "7" or
url.Chart EQ "8">
<cfquery name="Recordset1" datasource="hike">
Select '0-500' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 0 and 500
union
Select '501-1000' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 501 and 1000
union
Select '1001-1500' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 1001 and 1500
union
Select '1501-2000' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 1501 and 2000
union
Select '2001-2500' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 2001 and 2500
union
Select '2501-3000' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 2501 and 3000
union
Select '3001-3500' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 3001 and 3500
union
Select '3501-4000' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 3501 and 4000
union
Select '4001-4500' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 4001 and 4500
union
Select '4501-5000' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 4501 and 5000
union
Select '5001-5500' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 5001 and 5500
union
Select '5501-6000' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 5501 and 6000
union
Select '6001-6500' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 6001 and 6500
union
Select '6501-7000' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 6501 and 7000
union
Select '7001-7500' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 7001 and 7500
union
Select '7501-8000' as Elevation1, count(*) as NumOfHikes
>From Hike
where #ChartMe# between 7501 and 8000
</cfquery>
<cfelse>
<cfquery name="Recordset1" datasource="hike">
SELECT #ChartMe#, count(*) as
Chart_count
FROM hike
Where #ChartMe# is not null
group by #ChartMe#
order by #ChartMe#;
</cfquery>
</cfif>
<!--- I don't think you need to have both blocks necessarily. I need to
look at this later --->
<cfif IsDefined("URL.Chart") AND url.Chart EQ "6" or url.Chart EQ "7" or
url.Chart EQ "8">
<cfchart showborder="yes" show3d="yes" chartwidth="600"
chartheight="400" pieslicestyle="sliced"
url=""> lumns#&urlvalue=$ITEMLABEL$">
<cfchartseries type="pie"
query="Recordset1" itemcolumn="Elevation1" valuecolumn="NumofHikes">
</cfchartseries>
</cfchart>
<cfelse>
<cfchart showborder="yes" show3d="yes" chartwidth="600"
chartheight="400" pieslicestyle="sliced"
url=""> lumns#&urlvalue=$ITEMLABEL$">
<cfchartseries type="pie"
query="Recordset1" itemcolumn="#ChartMe#" valuecolumn="Chart_count">
</cfchartseries>
</cfchart>
</cfif>
-----Original Message-----
From: Jerry Johnson [mailto:[EMAIL PROTECTED]
Sent: Friday, November 14, 2003 10:54 AM
To: CF-Talk
Subject: RE: Question from a beginner
Well, after looking at the site, I completely miss living in Portland,
OR.
Boo Hoo!
Make the following changes and I think you can get there:
(The label will say 500, rather than the more proper 500-1000, but I
leave that as a detail for you to finish)
=)
Jerry Johnson
<cfif IsDefined("URL.Chart") AND url.Chart EQ "6">
<cfset ChartMe="ElevationGain">
<cfset ChartMeCalc="integer(ElevationGain/500)*500">
<cfset Title="Elevation Gained In Feet PieChart">
</cfif>
<!--- End Catch block for URL variables --->
<cfparam name="ChartMeCalc" default="#ChartMe#">
<cfquery name="Recordset1" datasource="hike">
SELECT #ChartMeCalc# as #ChartMe#, count(*) as Chart_count
FROM hike
Where #ChartMe# is not null
group by #ChartMeCalc#
order by #ChartMe#;
</cfquery>
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

