Need Help in displaying Line Chart

Tan

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.

Leigh

Error Occurred While Processing Request For input string: "2013-07-11".

<cfchartseries itemColumn="COUNT" valueColumn="Timestamp" ...>

The Y-Axis value should be numeric. The string "2013-07-11" is obviously not numeric, hence the error. Looks like you accidentally swapped itemColumn and valueColumn.

Update:

The chart code posted works fine with date strings and numeric counts (once you swap item/value).

<cfset qQuery = queryNew("")>
<cfset queryAddColumn(qQuery, "TimeStamp", "date", listToArray("2013-07-30,2013-08-01,2013-08-02"))>
<cfset queryAddColumn(qQuery, "Count", "integer", listToArray("10,8,6"))>

<cfchart format="flash" chartwidth="500" chartheight="500" showxgridlines="no">
    <cfchartseries type="line" 
        itemColumn="Timestamp" 
        valueColumn="Count"  
        query="qQuery" />
</cfchart> 

So if it is not working for you, you are doing something different in the code than what you have shown us. Please update your question with a small, self-contained, example that demonstrates the problem. Also "not working" is very vague description. You need to tell what IS happening and how it differs from what you expected. ie Actual versus expected results.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Need help with fread()

분류에서Dev

Need help on efficiency in raphael

분류에서Dev

Need help on SQL statement

분류에서Dev

Need help debugging C code

분류에서Dev

Need help to disable *:before and after

분류에서Dev

Need help understanding APDU response

분류에서Dev

Need help scripting with jar files

분류에서Dev

Need help with the rename command in Linux

분류에서Dev

Highcharts logarithmic chart not displaying series on webpage

분류에서Dev

Highcharts not displaying chart from csv file

분류에서Dev

Drawing a line over a chart

분류에서Dev

I need Plan of Attack! Please help

분류에서Dev

Need help installing a texture pack on Minecraft

분류에서Dev

Need help on looping through this state and showing the props

분류에서Dev

Need help looping through concatenation in R

분류에서Dev

Need help turning a jQuery object back into a string

분류에서Dev

Need help to resolve the join table issue

분류에서Dev

Creating MYSQL Database Table? Need Help Revising

분류에서Dev

Need help for R coding on aggregate function

분류에서Dev

Need help understanding a Python snippet.

분류에서Dev

Need Help Building List to Maximize Overall Output

분류에서Dev

Need help finding xygraph dependency in Maven

분류에서Dev

need help removing action from plugin file

분류에서Dev

Need a little help, in hiding/disabling the jbutton

분류에서Dev

Need help replacing hardcode in html and jquery

분류에서Dev

Need help developing SQL to find difference in date

분류에서Dev

Need help constructing a query to group related elements

분류에서Dev

Need help using Javascript to insert an onclick event

분류에서Dev

Need Help adding a difficulty option for User functionality