Please consider the following code:
Parameters I have used :
<cfparam name="Form.startdate" default="#dateformat(now()-5, 'mm/dd/yyyy')#">
<cfparam name="Form.enddate" default="#dateformat(now()-1, 'mm/dd/yyyy')#">
<cfparam name="Form.selectdate" default="#dateformat(now(), 'mm/dd/yyyy')#">
The cfquery I'm using is as follows:
Information: MyDatabase = Name of the Database
Events = Column name with several different events(First,Second,Third etc).In this case I have just included FIRST.
Timestamp = Name of the column which contains date and time.
<cfquery datasource = "XX.XX.X.XX" name="qQuery">
SELECT Timestamp , Count(*) as COUNT
FROM MyDatabase WHERE Events = "FIRST"
AND Timestamp >= <cfqueryparam value="#form.startdate#" cfsqltype="cf_sql_date">
AND Timestamp <= <cfqueryparam value="#dateAdd('d', 1, form.enddate)#" cfsqltype="cf_sql_date"> GROUP BY Timestamp;
</cfquery>
The above query is just displaying one dot in the line chart which is obvious because I have used there count clause with condition for Events = FIRST.
The way I'm displaying is as follows (Please consider the following code):
<cfform format="flash" preloader ="false">
<cfformgroup type="horizontal">
<cfinput type="dateField" name="startdate" label="Start Date" width="100" value="#form.startdate#">
<cfinput type="dateField" name="enddate" label="End Date" width="100" value="#Form.enddate#">
<cfinput name="submitApply" type="submit" value = "Apply">
<cfinput name="cancel" type="submit" value="Download CSV">
</cfformgroup>
<cfformitem type = "hrule" style="" ></cfformitem>
</cfform>
<cfchart format="flash" chartwidth="500" chartheight="500" scalefrom="0" scaleto="2500" showxgridlines="no" >
<cfchartseries type="line" itemColumn="Timestamp" valueColumn="COUNT" query="qQuery">
</cfchartseries>
</cfchart>
Problem I'm getting facing:
Nothing is displayed on the web browser except cfform
fields. :(
When I right click on it, it says Movie not loaded.
Please let me know if there are some questions I can answer.