Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

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 December 15th, 2001, 11:11 PM
dhardy123 dhardy123 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Hamilton, Ontario, Canada
Posts: 7 dhardy123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 25 sec
Reputation Power: 0
Send a message via ICQ to dhardy123
Question Line and/or Bar Charts

Is it possible to create a line and/or bar chart in Flash using data from a database?

I know about the LoadVariables stuff but I want the line to gradually make its way from left to right, or I want the bars to grow. I dont want a static graph, but rather with movement.

I haven't been able to find any tutorials on this and was wondering if it is possible, and if so, how can it be done.

Thanks

Reply With Quote
  #2  
Old December 27th, 2001, 11:08 AM
drGiggles drGiggles is offline
nerd
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: NJ
Posts: 101 drGiggles User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 30 m 37 sec
Reputation Power: 7
sorry but only half my post shows ??@#$?
so i'll put the code in when a moderator tells me what the hell is going on

Last edited by drGiggles : December 27th, 2001 at 11:16 AM.

Reply With Quote
  #3  
Old December 27th, 2001, 11:18 AM
dhardy123 dhardy123 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Hamilton, Ontario, Canada
Posts: 7 dhardy123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 14 m 25 sec
Reputation Power: 0
Send a message via ICQ to dhardy123
Thanks, I'd appreciate it

Reply With Quote
  #4  
Old December 27th, 2001, 11:26 AM
drGiggles drGiggles is offline
nerd
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: NJ
Posts: 101 drGiggles User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 30 m 37 sec
Reputation Power: 7
here goes again

didn't work again - just pm me and i'll email you the solution

Reply With Quote
  #5  
Old December 27th, 2001, 11:48 AM
ZeUs's Avatar
ZeUs ZeUs is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Location: St. George, Utah
Posts: 63 ZeUs User rank is Sergeant Major (2000 - 5000 Reputation Level)ZeUs User rank is Sergeant Major (2000 - 5000 Reputation Level)ZeUs User rank is Sergeant Major (2000 - 5000 Reputation Level)ZeUs User rank is Sergeant Major (2000 - 5000 Reputation Level)ZeUs User rank is Sergeant Major (2000 - 5000 Reputation Level)ZeUs User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 31
drGiggles sent this solution to me in my e-mail. Here's my try at posting it:

Quote:
Quote:
Is it possible to create a line and/or bar
chart in Flash using data from a database?


yes, you can. you can experiment this to get a basic
idea how this works:

create text file containing nothing but:
&surveyResults=5|4|1|3|2

make a new movie, on the first frame add the AS:
Code:
loadVariablesNum ("viewerSurvey.txt", 0);


create a button, named splitter, containing the AS:
Code:
on(press) {
	surveyArray = surveyResults.split("|");
	element0=surveyArray[0];// element 0
	element1=surveyArray[1];
	element2=surveyArray[2];
	element3=surveyArray[3];
	element4=surveyArray[4];
}

__________________
Lucas Marshall

Reply With Quote
  #6  
Old December 27th, 2001, 11:58 AM
drGiggles drGiggles is offline
nerd
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Location: NJ
Posts: 101 drGiggles User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 30 m 37 sec
Reputation Power: 7
unfortunately the rest of the code wasnot there either. i suspect it is because of the multiple 'code' inserts. if this doesn't show, i don't know what to tell you....here it is without any vB markup:

Is it possible to create a line and/or bar chart in Flash using data from a database?

yes, you can. you can experiment this to get a basic idea how this works:

create text file containing nothing but:
&surveyResults=5|4|1|3|2

make a new movie, on the first frame add the AS:
loadVariablesNum ("viewerSurvey.txt", 0);

create a button, splitter, containing the AS:
on(press) {
surveyArray = surveyResults.split("|");
element0=surveyArray[0];// element 0
element1=surveyArray[1];
element2=surveyArray[2];
element3=surveyArray[3];
element4=surveyArray[4];
}

create a dynamic text box labeled surveyResults

create 5 dynamic text boxes labeled element0...element4.

add a second button, showMe, with the AS:

on (release) {
setProperty (dynamicBar, _height, element0 * 10);
}

now make a new movie symbol called dynamicBar, and draw a box h=1, w=50, make the x=0, y=-1.

now play the movie, hit the splitter first, then the showMe button.

Congrats! what you've done is take in a datasource, split the array it contains, show what was in it, and then make the dynamicBar resize according to the datasource!

this should give you the idea how to get started - good luck!

Last edited by drGiggles : December 27th, 2001 at 12:02 PM.

Reply With Quote
  #7  
Old December 27th, 2001, 04:13 PM
alligatorTim alligatorTim is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 45 alligatorTim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 51 m 37 sec
Reputation Power: 8
there's a cheesy bargraph tutorial that would work with a database here:

http://www.flashkit.com/tutorials/D...-61/index.shtml

Reply With Quote
  #8  
Old August 5th, 2003, 12:38 AM
ttheunis ttheunis is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 9 ttheunis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
it can be quite easy to draw dynamic charts in flash mx.
my first experience with flash was to create such graphics and not to forget how it works, i made a tutorial on it.
the source is downloadable. it runs out of the box but is also highly configurable, even on the fly.

i used mysql, perl, flash mx and xml. can also be static or read from a file. xml nothing special, just tagged name-value pairs.

see for more details
http://www.2question.com/demo and follow the dynamic pie chart link.

theo theunissen
www.2question.com

Reply With Quote
  #9  
Old August 6th, 2003, 07:53 PM
blatant's Avatar
blatant blatant is offline
World Domination
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: San Diego
Posts: 126 blatant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 47 m 17 sec
Reputation Power: 6
Send a message via AIM to blatant
or just download the flash charting components from the flash exchange . . .

Reply With Quote
  #10  
Old August 7th, 2003, 08:57 AM
kinase01 kinase01 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 1 kinase01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
try this URL
for a line graph drawn from an xml file.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Line and/or Bar Charts


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 1 hosted by Hostway