图形定义:
<mx:ColumnChart id="eColsLineChart" width="100%" height="100%" paddingLeft="5" paddingRight="5"
showDataTips="true" styleName="multiColumnLineChart" seriesFilters="[]" dataProvider="{data1}" dataTipFunction="dataTip">
as中定义:
//展示框自定义
private function dataTip(item:HitData):String
{ var temp:String=item.chartItem.toString();
var type:String=temp.substring(temp.indexOf(" ")+1,temp.length-1);//图形的类型
var content:ChartItem=item.chartItem as ChartItem;
if("LineSeriesItem"==type){
var conty:String=LineSeries(content.element).yField;
var contx:String=LineSeries(content.element).xField;
var name:String=LineSeries(content.element).displayName;
return "城市:"+content.item[contx]+"\n"+name+":"+content.item[conty];
}
else
{
var conty1:String=ColumnSeries(content.element).yField;
var contx1:String=ColumnSeries(content.element).xField;
var name:String=ColumnSeries(content.element).displayName;
return "城市:"+content.item[contx1]+"\n"+name+":"+content.item[conty1];
}
}