Allen Walker
Allen Walker

Reputation: 866

How to create PieSeries interpolation in flex 4.5 at run time

i make a PieChart at run time, and i want to interpolate data change, but i have some difficult. The Code is here:

//Pie Chart
pieChart.dataProvider = expenses;

var pieSeries:PieSeries = new PieSeries();
pieSeries.nameField = "position";
pieSeries.field = "value";
pieSeries.explodeRadius = 0.08;
pieChart.series = null;
pieChart.series.push(pieSeries);

I found two method, but i don't know how to use that >.<:

pieSeries.beginInterpolation
pieSeries.interpolate

Upvotes: 0

Views: 736

Answers (1)

Be Free Studios
Be Free Studios

Reputation: 110

1) First create a SeriesInterpolate class instance and customize it however you want.

2) You can set the showDataEffect style of your pieSeries object to the interpolate object that you just created.

Whalah.. whenever your data changes the interpolator will get triggered.

See the code snippet below.. I've also created an example application with source enabled. goto: http://befreestudiosllc.com/demos/flex4/charting/seriesInterpolate/ and right-click to view source.

// Create an interpolator and customize its properties
var interpolateDataIn:SeriesInterpolate = new SeriesInterpolate();
interpolateDataIn.duration = 1000;
var pieSeries:PieSeries = new PieSeries();
pieSeries.setStyle("showDataEffect", interpolateDataIn); // apply interpolators to your series through show/hide dataEffects

Upvotes: 1

Related Questions