?
Solved

cfquery, cfchart, and cfchartseries help

Posted on 2005-03-02
12
Medium Priority
?
357 Views
Last Modified: 2013-12-24
Hi,
I'm trying to create a bar/line chart.  I have to show values for last 5 months.  I think i got the query and getting result.  when i use <cfchart> and <cfchartseries> tags to pull up values on a chart i get 3-4 different  graphs with the same values instead of showing values for each months on one graph.  Also on the graph i only get 3 months values instead of 5 months.

<CFQUERY NAME="query_name" DATASOURCE="Datasource_name">
SELECT Wtr_Distr_DataEntry_Date, Wtr_Distr_Sys_Int_Rate from Wtr_Distribution_System_Integrity where
MONTH(Wtr_Distr_DataEntry_Date) > (month(getdate()) - 5)
</cfquery>

 <cfchart chartheight="340" chartwidth="800" format="flash" font="ARIAL" foregroundcolor="WHITE"fontsize="18" databackgroundcolor = "BLACK"  backgroundcolor="BLACK"
yaxistitle="Water Distr Sys Integrity" showygridlines="yes" showlegend="YES" xaxistitle="Months" scalefrom="0" scaleto="20" gridlines="5"
show3d="NO" seriesplacement="stacked">

<cfchartseries seriescolor="66CCFF" type="line" query="query_name" itemcolumn="Wtr_Distr_DataEntry_Date" valuecolumn="Wtr_Distr_Sys_Int_Rate">

  </cfchartseries>

  </cfchart>

Please help me with this.
Thanks - KD
0
Comment
Question by:kuntald
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
  • 2
  • +1
12 Comments
 

Author Comment

by:kuntald
ID: 13443749
hi,
i just figured out a way to put values in one graph but i'm still having a problem with the months.  It still pulls up only 3 months even though i have 5 rows(months) in a table.

Thanks.
KD
0
 
LVL 5

Expert Comment

by:kkhipple
ID: 13443818
simple things to try is first do a CFDUMP of what your query is bringing...  that should tell you if ur getting info for 3 mths or 5... this way you can determine if the issue is with the query or with the info ur passing ot the chart
0
 

Author Comment

by:kuntald
ID: 13443893
I'm not sure how to test with CFDUMP tag.  can you show me the code?  I tested a query in Query Analyzer and getting 5 months.

Thanks,
Kuntal
0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 
LVL 21

Expert Comment

by:pinaldave
ID: 13443960
Hi kuntald,
are those month different or same... just curious...
is it like jan, feb, mar, apr
or like jan, jan, feb, mar, mar

Regards,
---Pinal
0
 

Author Comment

by:kuntald
ID: 13444015
It's Jan, Feb, March ....

Thanks
0
 
LVL 4

Expert Comment

by:wolffy18
ID: 13444030
to do a cfdump:

<cfdump var="#query_name#">


This will show you all records returned  in a table format.
0
 

Author Comment

by:kuntald
ID: 13444156
ok.  this shows only 3 rows.  so do i guess i need to change my query?  the same query brings up 5 rows in query analyzer.  I'm not sure how else can I change my query.  

SELECT datename(month, convert(varchar(11), Wtr_Distr_DataEntry_Date, 101)) as month_1, datename(year, convert(varchar(11), Wtr_Distr_DataEntry_Date, 101)) as year_1,
Wtr_Distr_Sys_Int_Rate from Wtr_Distribution_System_Integrity_test where MONTH(Wtr_Distr_DataEntry_Date) > (month(getdate()) - 12)

Thanks.
0
 
LVL 5

Expert Comment

by:kkhipple
ID: 13444192
is there 5mths of data available?   or is there only 3 mths of data avail ?

im not thinking straight and having a look at your query ... so maybe play around with that
0
 

Author Comment

by:kuntald
ID: 13444226
I have 5 months data in my table.  I changed my query to select * from table and tested with <cfdump> and it still pull up 3 months of data.  
0
 

Author Comment

by:kuntald
ID: 13445125
I got it.  I had to put Set Rowcount 5 then i can see all 5 rows.  That's strange to me that if you select all shoud populate all rows.  i think <cfquery> by default set to populate 3 rows only, i guess.  

I have another question related to cfchart.  is there a way i can show up values on the top of each bar?

Thanks for all your help!
0
 
LVL 21

Accepted Solution

by:
pinaldave earned 1500 total points
ID: 13446368
Hi kuntald,
no this is the draw back of CF. It does not show the values on the top of the bars or chart.
Sometimes if you are ready to pay more you can buy custom tags.

Regards,
---Pinal
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question