Adobe 声明移动项目支持图表,但是当我尝试更改以下工作文件时(使用 File - New - Flex Mobile Project - Google Nexus One 创建的项目):
我的测试.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:MobileApplication
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
firstView="views.MyTestHome">
<s:navigationContent>
<s:Button label="Home"
click="navigator.popToFirstView();"/>
</s:navigationContent>
<s:actionContent/>
</s:MobileApplication>
我的TestHome.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
title="Test Chart">
</s:View>
到新的 MyTestHome.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark"
title="Test Chart">
<fx:Script>
<![CDATA[
import mx.collections.*;
[Bindable]
private var medalsAC:ArrayCollection =
new ArrayCollection( [
{Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
{Country:"China", Gold: 32, Silver:17, Bronze: 14 },
{Country:"Russia", Gold: 27, Silver:27, Bronze: 38 }
]);
]]>
</fx:Script>
<mx:PieChart id="chart" height="100%" width="100%"
paddingRight="5" paddingLeft="5" color="0x323232"
dataProvider="{medalsAC}" >
<mx:series>
<mx:PieSeries labelPosition="callout" field="Gold">
<mx:calloutStroke>
<s:SolidColorStroke weight="0"
color="0x888888" alpha="1.0"/>
</mx:calloutStroke>
<mx:radialStroke>
<s:SolidColorStroke weight="0"
color="#FFFFFF" alpha="0.20"/>
</mx:radialStroke>
<mx:stroke>
<s:SolidColorStroke color="0"
alpha="0.20" weight="2"/>
</mx:stroke>
</mx:PieSeries>
</mx:series>
</mx:PieChart>
</s:View>
并添加
- c:\Program Files\Adobe\Adobe Flash Builder Burrito\sdks\4.5.0\frameworks\libs\datavisualization.swc
- c:\Program Files\Adobe\Adobe Flash Builder Burrito\sdks\4.5.0\frameworks\libs\sparkskins.swc
- c:\Program Files\Adobe\Adobe Flash Builder Burrito\sdks\4.5.0\frameworks\libs\mx\mx.swc
到 Flex 构建路径(单击“添加 SWC”按钮):
然后它失败并出现错误:
无法解析为组件实现。
有人在这里有想法吗?