开发者

How to create PieSeries interpolation in flex 4.5 at run time

开发者 https://www.devze.com 2023-04-11 23:01 出处:网络
i make a PieChart at run time, and i want to interpolate data change, but i have some difficult. The Code is her开发者_如何转开发e:

i make a PieChart at run time, and i want to interpolate data change, but i have some difficult. The Code is her开发者_如何转开发e:

//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


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号