基本的方法是在线图上画点!
代码如下:
<mx:ColumnChart id="chart" fontSize="12" width="990%" height="100%" showDataTips="true" >
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="history_mon"/>
</mx:horizontalAxis>
<mx:series>
<mx:LineSeries yField="arpu" displayName="历史ARPU值" creationComplete="addRender(event)"></mx:LineSeries>
<mx:LineSeries yField="mou" displayName="历史MOU值" creationComplete="addRenderM(event)"></mx:LineSeries>
</mx:series>
</mx:ColumnChart>
<mx:Legend dataProvider="{chart}" horizontalAlign="center" direction="horizontal"/>
描点代码:
private function addRender(event:Event):void
{
var factory:ClassFactory = new ClassFactory(LineSeriesItemRenderer);
factory.properties = {color:0xE48701};
(event.target as LineSeries).setStyle("itemRenderer", factory);
}
private function addRenderM(event:Event):void
{
var factory:ClassFactory = new ClassFactory(LineSeriesItemRenderer);
factory.properties = {color:0x33FF66};
(event.target as LineSeries).setStyle("itemRenderer", factory);
}