# Dynamic Graph

**URL:** https://forum.kirupa.com/t/dynamic-graph/306
**Category:** flash
**Created:** [July 12, 2002, 10:18pm UTC](https://forum.kirupa.com/t/dynamic-graph/306 "2002-07-12T22:18:35Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![windy](https://avatars.discourse-cdn.com/v4/letter/w/91b2a8/32.png) [@windy](https://forum.kirupa.com/u/windy)
#### Post date: [July 12, 2002, 10:18pm UTC](https://forum.kirupa.com/t/dynamic-graph/306/1 "2002-07-12T22:18:35Z")

</div>

Guys  
Please check the following link.  
[http://www.notestips.com/flashchart1.html](http://www.notestips.com/flashchart1.html)

if you click on update chart, you will see the bars setting up as per the field value.

this guy who created the chart has given a maths equation to set the bar height according to field value.

duplicateMovieClip(“y”, bar, m);  
setProperty(bar, \_width, Number(Lenght)/Number(NoOfValues));  
setProperty(bar, \_x, Number(getProperty(XAxis, \_x))+Number((2_n-1)/2_(Number(getProperty(bar, \_width))+10)));  
setProperty(bar, \_height, (eval(“y” add n)/max)\*Hight);  
setProperty(bar, \_y, Number(getProperty(yAxis, \_y))-Number(getProperty(bar, \_height))/2);

Since i am not that familiar with actionscript, i am confused how he calculates the bar height.

he has taken the major source help from flash kit tutorial, dynamic flash chart.

I need a simple code to calculate the bar height.  
thanks for your help.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 12, 2002, 10:21pm UTC](https://forum.kirupa.com/t/dynamic-graph/306/2 "2002-07-12T22:21:35Z")

</div>

Kirupa,  
I checked your duplicate movie tutorial. it was really helpful. this is similar kind but instead of passing random values, i am passing text values. also i need to make sure that the x-axis and y axis remains the same and only the height changes.

Please do help. this is very urgent.  
thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 13, 2002, 1:20pm UTC](https://forum.kirupa.com/t/dynamic-graph/306/3 "2002-07-13T13:20:32Z")

</div>

You’re not telling us everything, Windy. There are two things that are not clear in this : how does he take the values from the HTML page, and the duplication must be part of a loop, or it won’t do all the bars.

About the bar height : quite obviously, it’s this line that deals with it

```auto
setProperty(bar, _height, (eval("y" add n)/max)*Hight);

```

This puts the property \_height of the bar to the value indicated. This value should be the number you entered in the HTML divided by the maximum of all the values entered. Proportionnality. But the notations are not clear here.

Last but not least, it’s an old syntax. You should really try to change it.

```auto
duplicateMovieClip("y", bar, m); 
bar. _width=Lenght/NoOfValues; 
bar._x=XAxis_x+(2*n-1)/2*bar._width+10;
and so on...

```

pom :asian:

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 14, 2002, 4:29am UTC](https://forum.kirupa.com/t/dynamic-graph/306/4 "2002-07-14T04:29:59Z")

</div>

[http://www.flashkit.com/tutorials/Dynamic\_Content/Creating-Zoubin\_Z-61/index.shtml](http://www.flashkit.com/tutorials/Dynamic_Content/Creating-Zoubin_Z-61/index.shtml)

Ilayamse,  
please be informed that he took the major help from the above eg in flash kit. in this eg, instead of using the text data file, he is passing the values from html.  
also to adjust the height of the bar,  
he has used bar height/max value \* hight, what is this hight??

i am familiar with passing values from html form/fields in flash but that actionscript involved in calculating the height of the bar after passing the value is quite challenging!

please help me…  
thanks

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 14, 2002, 5:34am UTC](https://forum.kirupa.com/t/dynamic-graph/306/5 "2002-07-14T05:34:07Z")

</div>

That’s Flash 4, man…  
Anyway, this hight has got to be initialized somewhere, and it’s simply a constant. It means that if your ratio increases by 1, the size of your bar will increase by hight.

pom :asian:
