School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,378 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,528 people online right now. Registration is fast and FREE... Join Now!




CFCHART not displaying the correct information

 

CFCHART not displaying the correct information

Ennio

12 Jun, 2009 - 05:52 AM
Post #1

New D.I.C Head
*

Joined: 29 May, 2008
Posts: 22



Thanked: 1 times
My Contributions
I have a chart that is created with data from a query. But the problem is that sometimes the chart does not display the correct data.

I have a query that gets how many customer a therapist saw in a day, but the pronlem is that some of the therapist does not work every single day and when I pull out the query the graph just carry over the data from the previous data they had and display that instead of displaying 0.

here is the two queries that I'm using to create the chart.

CODE

                <!--- GET A SINGLE THERAPIST DATA --->
                <cfquery name="qryGetPatientSeen" datasource="sptc_billing">
                    SELECT Count(slipID) AS PatientSeen, apptDate
                      FROM billing_slips
                     WHERE apptDate >= #createODBCdate(Form.Fromdate)#
                       AND apptDate <= #createODBCdate(Form.Todate)#
                       AND therapist = '#Form.therapist#'
                       AND status = '1'
                       AND billStatus IN ('2','3')
                  GROUP BY apptDate  
                  ORDER BY apptDate
                </cfquery>

                <!--- GET ALL THE DATA FROM ALL THERAPISTS --->
                <cfquery name="qryGetPatientSeenAll" datasource="sptc_billing">
                    SELECT Count(slipID) AS PatientSeen, apptDate
                      FROM billing_slips
                     WHERE apptDate >= #createODBCdate(Form.Fromdate)#
                       AND apptDate <= #createODBCdate(Form.Todate)#
                       AND status = '1'
                       AND billStatus IN ('2','3')
                  GROUP BY apptDate  
                  ORDER BY apptDate
                </cfquery>  


Here is the creation of the chart code

CODE

                <cfchart format="flash" style="beige" chartwidth="700" labelformat="number">
                    <cfchartseries type="line" serieslabel="#Form.therapist#">
                        <cfoutput query="qryGetPatientSeen">
                            <cfchartdata item="#DateFormat(apptDate, 'mm/dd/yyyy')#" value="#PatientSeen#">
                        </cfoutput>
                    </cfchartseries>
                    <cfchartseries type="line" serieslabel="#Form.therapist#">
                        <cfoutput query="qryGetPatientSeenAll">
                            <cfchartdata item="#DateFormat(apptDate, 'mm/dd/yyyy')#" value="#PatientSeen#">
                        </cfoutput>
                    </cfchartseries>
                </cfchart>


Attached is a screen shot witht he problem. Also you can see that the data is messing up because the dates get out of order.

So if I can just display 0 where the therapist has no data it would be great.


Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/7/09 09:20PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month