这边主要研究的是这个组件里面的比较有特点的东西.
Part1:
<mx:SeriesInterpolate id="interpolate" elementOffset="5"/> 这个SeriesInterpolate是个效果
The SeriesInterpolate
effect moves the graphics that represent the existing data in the series to the new points. Instead of clearing the chart and then repopulating it as with SeriesZoom
and SeriesSlide
, this effect keeps the data on the screen at all times.
elementOffset属性,我没找出来,但是我设置不同的值,看了效果,发现这个属性应该是点与点之间的延时.值设置得越大动画效果越慢.
Part2:
<mx:ViewStack id="vs" width="100%" height="100%" changeEffect="Fade"> 这个ViewStack是个Container
A ViewStack navigator container consists of a collection of child containers stacked on top of each other, where only one child at a time is visible. When a different child container is selected, it seems to replace the old one because it appears in the same location. However, the old child container still exists; it is just invisible.
A ViewStack container does not provide a user interface for selecting which child container is currently visible. Typically, you set its selectedIndex
or selectedChild
property in ActionScript in response to some user action. Alternately, you can associate a LinkBar or TabBar container with a ViewStack container to provide a navigation interface. To do so, specify the ViewStack container as the value of the dataProvider
property of the LinkBar or TabBar container.
You might decide to use a more complex navigator container than the ViewStack container, such as a TabNavigator container or Accordion container. In addition to having a collection of child containers, these containers provide their own user interface controls for navigating between their children.
上面的我翻译不来,但是可以看懂,其实它与TabNavigate的区别主要是否提供按钮让用户切换,ViewStack不提供,只能用代码切换.
Part3:
<mx:LineChart dataProvider="{monthData}" showDataTips="true" width="100%" height="100%" dataTipFunction="formatDataTip"
mouseClickData="monthChange(event.hitData.index)">
这个主要讲的是showDataTips,就是是否显示临界值的提示. dataTipFunction=formatDataTip,这个函数主要的功能是算得临界值的提示的内容. mouseClickData = "mouseChange(event.hitData.index)",这个事件主要的就是当用户点击临界值点的时候,赋值并且分发monthChange事件