想画个曲线图,可是老是direction属性无法解析。求教
改别的属性也不行。删除可以。。
<?xml version="1.0"?>
<!-- Simple example to demonstrate the GridLines class. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
private var expensesAC:ArrayCollection = new ArrayCollection( [
{ Month: "Jan", Profit: 2000, Expenses: 1500, Amount: 450 },
{ Month: "Feb", Profit: 1000, Expenses: 200, Amount: 600 },
{ Month: "Mar", Profit: 1500, Expenses: 500, Amount: 300 },
{ Month: "Apr", Profit: 1800, Expenses: 1200, Amount: 900 },
{ Month: "May", Profit: 2400, Expenses: 575, Amount: 500 } ]);
]]>
</mx:Script>
<mx:Panel title="GridLines Example" height="100%" width="100%">
<mx:LineChart id="linechart" height="100%" width="100%"
paddingLeft="5" paddingRight="5"
showDataTips="true" dataProvider="{expensesAC}">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="Month"/>
</mx:horizontalAxis>
<mx:backgroundElements>
<mx:GridLines direction="horizontal">
<mx:horizontalStroke>
<mx:Stroke weight="1"/>
</mx:horizontalStroke>
<mx:horizontalFill>
<mx:SolidColor color="0xCCCCCC" alpha=".66"/>
</mx:horizontalFill>
</mx:GridLines>
</mx:backgroundElements>
<mx:series>
<mx:LineSeries yField="Profit" form="curve" displayName="Profit"/>
<mx:LineSeries yField="Expenses" form="curve" displayName="Expenses"/>
<mx:LineSeries yField="Amount" form="curve" displayName="Amount"/>
</mx:series>
</mx:LineChart>
<mx:Legend dataProvider="{linechart}"/>
</mx:Panel>
</mx:Application>
无法为组件类型“mx.charts.GridLines”解析属性“direction”。myFlex.mxml/myFlex/srcline 31
[解决办法]
GridLines 没有这个属性direction 当然无法解析了
[解决办法]
楼主sdk是哪个版本的?可能是版本问题,我这把代码铐过来是没有问题的。
我的是3.2