|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
Thanks, I'd appreciate it
|
|
#4
|
|||
|
|||
|
here goes again
didn't work again - just pm me and i'll email you the solution
|
|
#5
|
||||
|
||||
|
drGiggles sent this solution to me in my e-mail. Here's my try at posting it:
Quote:
__________________
Lucas Marshall |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||
|
|||
|
there's a cheesy bargraph tutorial that would work with a database here:
http://www.flashkit.com/tutorials/D...-61/index.shtml |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
||||
|
||||
|
or just download the flash charting components from the flash exchange . . .
|
|
#10
|
|||
|
|||
|
try this URL
for a line graph drawn from an xml file. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Line and/or Bar Charts |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|