ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 21st, 2003, 10:28 AM
hokiecsgrad hokiecsgrad is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 5 hokiecsgrad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
CFMX graphing using cfchart

Greetings,

I'm trying to create a graph with two different chart series over top of each other. The problem that I'm running into is that each chart series is unrelated to the other. The only thing they have in common is the ranges of the x and y data. In this case, the x's fall in between 20 and 100 and y's fall in between 70.000 and 390.000.

Here's a sample of my data:

Series 1 (x,y)
----------
25, 99.357
31, 123.697
43, 163.415
52, 194.176
74, 314.805
87, 366.572

Series 2 (x,y)
----------
20, 74.311
25, 93.765
30, 113.589
35, 133.794
40, 154.391
45, 175.391
50, 196.807
55, 218.652
60, 240.937
65, 263.676
70, 286.884
75, 310.576
80, 334.765
85, 359.469
90, 384.704

What I'm finding is that Cold Fusion will actually display the series side-by-side instead of overlapping. It SEEMS that unless the "item" attribute of the <cfchartdata> tags line up in the different series, then the graph won't display the series as overlapping, but rather side by side.

Here is the code I'm using...
<cfchart>
<cfchartseries type="scatter">
<cfchartdata item="25" value="99.357">
<cfchartdata item="31" value="123.697">
<cfchartdata item="43" value="163.415">
<cfchartdata item="52" value="194.176">
<cfchartdata item="74" value="314.805">
<cfchartdata item="87" value="366.572">
</cfchartseries>

<cfchartseries type="curve">
<cfloop index="i" from="20" to="90" step="5">
<cfchartdata item="#i#" value="#i / ( 0.27919 + ( -0.0005027 * i ) )#">
</cfloop>
</cfchartseries>
</cfchart>


Any and all help is appreciated. I can't imagine that I'm asking for a lot here, it seems pretty straight forward.

--Ryan

Reply With Quote
  #2  
Old August 21st, 2003, 03:18 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,648 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 12 h 8 m 8 sec
Reputation Power: 53
I think your data is messing with the graphing engine because the 2 data sets do not have similar x-axis values. If you tried to graph larger data sets with differing x-axis values the graph's labels would get crowded fast. So the engine is displaying them as separate graphs. If possible, try making the x-axis values the same in the 2 data sets, like this (you can get cf_querysim from www.halhelms.com for free):

<cf_querysim>
series1
item,value
25|99.357
31|123.697
43|163.415
52|194.176
74|314.805
87|366.572
</cf_querysim>
<cf_querysim>
series2
item,value
25|89.357
31|113.697
43|143.415
52|174.176
74|384.805
87|326.572
</cf_querysim>

<cfchart format="flash" scalefrom="0" scaleto="400" seriesplacement="cluster" labelformat="number" tipstyle="mouseOver" pieslicestyle="sliced">
<cfchartseries type="line" query="series1" itemcolumn="item" valuecolumn="value" serieslabel="Series 1"/>
<cfchartseries type="line" query="series2" itemcolumn="item" valuecolumn="value" serieslabel="Series 2"/>
</cfchart>

Reply With Quote
  #3  
Old August 26th, 2003, 10:26 AM
hokiecsgrad hokiecsgrad is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 5 hokiecsgrad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks!

Not the answer I was looking for, but it is an answer. I can't do any data interpolation or I risk misleading the user.

While I find that I can't do what I want using CFMX natively, I have found a few graphing servers that will do the trick nicely.

http://www.corda.com/
http://demo.visualmining.com/index.jsp

Also, if you need to do something similar in PHP, I HIGHLY recommend this package:

http://www.aditus.nu/jpgraph/index.php

Thanks again!
--Ryan

Reply With Quote
  #4  
Old January 17th, 2005, 08:47 PM
harkirat harkirat is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2004
Posts: 1 harkirat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi Ryan !
Incase you are still interested I managed to solve the problem...with a little help from an angel in Macromedia called Anne.

She suggested that I use the sortXaxis attribute and set it to true i.e. sortXAxis="yes" and that did the trick.

Also make sure that the 'xaxistype' and 'yaxistype' attributes are set to "scale" which allows the graphing engine to sort the x axis taking the values as numeric quantities.

Regards
Harkirat

Quote:
Originally Posted by hokiecsgrad
Greetings,

I'm trying to create a graph with two different chart series over top of each other. The problem that I'm running into is that each chart series is unrelated to the other. The only thing they have in common is the ranges of the x and y data. In this case, the x's fall in between 20 and 100 and y's fall in between 70.000 and 390.000.

Here's a sample of my data:

Series 1 (x,y)
----------
25, 99.357
31, 123.697
43, 163.415
52, 194.176
74, 314.805
87, 366.572

Series 2 (x,y)
----------
20, 74.311
25, 93.765
30, 113.589
35, 133.794
40, 154.391
45, 175.391
50, 196.807
55, 218.652
60, 240.937
65, 263.676
70, 286.884
75, 310.576
80, 334.765
85, 359.469
90, 384.704

What I'm finding is that Cold Fusion will actually display the series side-by-side instead of overlapping. It SEEMS that unless the "item" attribute of the <cfchartdata> tags line up in the different series, then the graph won't display the series as overlapping, but rather side by side.

Here is the code I'm using...
<cfchart>
<cfchartseries type="scatter">
<cfchartdata item="25" value="99.357">
<cfchartdata item="31" value="123.697">
<cfchartdata item="43" value="163.415">
<cfchartdata item="52" value="194.176">
<cfchartdata item="74" value="314.805">
<cfchartdata item="87" value="366.572">
</cfchartseries>

<cfchartseries type="curve">
<cfloop index="i" from="20" to="90" step="5">
<cfchartdata item="#i#" value="#i / ( 0.27919 + ( -0.0005027 * i ) )#">
</cfloop>
</cfchartseries>
</cfchart>


Any and all help is appreciated. I can't imagine that I'm asking for a lot here, it seems pretty straight forward.

--Ryan

Reply With Quote
  #5  
Old January 18th, 2005, 07:33 AM
hokiecsgrad hokiecsgrad is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 5 hokiecsgrad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Heya,

Thanks for posting your solution. The question was posted ages ago, but hopefully someone will find your response helpful. FYI, we ended up buying Corda's PopCharts. We needed some pretty advanced functionality that just wasn't possible within CFMX and we found it with PopCharts.

--Ryan

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > CFMX graphing using cfchart


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway