# Dynamic Pie Chart - Flash mx2004 Professional

**URL:** https://forum.kirupa.com/t/dynamic-pie-chart-flash-mx2004-professional/58419
**Category:** flash
**Created:** [July 22, 2004, 8:27am UTC](https://forum.kirupa.com/t/dynamic-pie-chart-flash-mx2004-professional/58419 "2004-07-22T08:27:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Maryna](https://avatars.discourse-cdn.com/v4/letter/m/a6a055/32.png) [@Maryna](https://forum.kirupa.com/u/Maryna)
#### Post date: [July 22, 2004, 8:27am UTC](https://forum.kirupa.com/t/dynamic-pie-chart-flash-mx2004-professional/58419/1 "2004-07-22T08:27:33Z")

</div>

[font=Courier New]Hi all,[/font]  
[font=Courier New]I have a question for you…I’m not able di draw a pie chart dynamically.[/font]  
[font=Courier New]I have the Layer1 with a F3DPieChart, 4 input text and a button, I put 4 numer in the 4 inputtext (sum total = 100) and when I press the button I would like to see pie Chart to appear with 4 slices that rappresented my 4 numbers.unfortunately it doesn’t happen.[/font]  
[font=Courier New]This is the code on layer1:[/font]

[font=Courier New][QUOTE][/font]  
[font=Helv][size=2][font=Courier New]var buttonListener = new Object();[/font]

[font=Courier New]buttonListener.click = function() {[/font]  
[font=Courier New]var val;[/font]  
[font=Courier New]var dp = new DataProviderClass();[/font]  
[font=Courier New]val = \_root.t1.text;[/font]  
[font=Courier New]dp.addItem ({data:val, color:0xFF0000, label: “1”});[/font]  
[font=Courier New]val = \_root.t2.text;[/font]  
[font=Courier New]dp.addItem ({data:val, color:0x00FF00, label: “2”});[/font]  
[font=Courier New]val = \_root.t3.text;[/font]  
[font=Courier New]dp.addItem ({data:val, color:0x0000FF, label: “3”});[/font]  
[font=Courier New]val = \_root.t4.text;[/font]  
[font=Courier New]dp.addItem ({data:val, color:0xFFFF00, label: “4”});[/font]  
[font=Courier New]}[/font]  
[font=Courier New]disegno = function(chart){[/font]  
[font=Courier New]chart.removeAll(); [/font]  
[font=Courier New]chart.setDataProvider(dp);[/font]  
[font=Courier New]delete dp;[/font]  
[font=Courier New]}[/font]  
[font=Courier New]\_root.button.addEventListener(“click”, buttonListener);[/font]  
[font=Courier New]Any help is apprecciate,[/font]  
[font=Courier New]Maryna.[/font]  
[/size][/font]
