ColumnChart : type introuvable
Bonjour,
je début en MXML et je suis devant un problème : je veux faire un graphique en me basant sur ColumChart. J'ai recopié bêtement le code proposé par Adobe mais en le compilant j'ai une erreur du type "#1046 Ce type est introuvable ou n'est pas une constante de compilation : ColumnChart." J'ai le même problème avec BarChart...
D'où vient mon problème ?
Pour info, je redonne le code d'exemple :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
|
<?xml version="1.0"?>
<!-- Simple example to demonstrate the ColumnChart and BarChart controls. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[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 } ]);
]]>
</mx:Script>
<!-- Define custom colors for use as fills. -->
<mx:SolidColor id="sc1" color="yellow" alpha=".8"/>
<mx:SolidColor id="sc2" color="0xCCCCCC" alpha=".6"/>
<mx:SolidColor id="sc3" color="0xFFCC66" alpha=".6"/>
<!-- Define custom Strokes for the columns. -->
<mx:Stroke id="s1" color="yellow" weight="2"/>
<mx:Stroke id="s2" color="0xCCCCCC" weight="2"/>
<mx:Stroke id="s3" color="0xFFCC66" weight="2"/>
<mx:Panel title="ColumnChart and BarChart Controls Example"
height="100%" width="100%" layout="horizontal">
<mx:ColumnChart id="column"
height="100%"
width="45%"
paddingLeft="5"
paddingRight="5"
showDataTips="true"
dataProvider="{medalsAC}"
>
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="Country"/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries
xField="Country"
yField="Gold"
displayName="Gold"
fill="{sc1}"
stroke="{s1}"
/>
<mx:ColumnSeries
xField="Country"
yField="Silver"
displayName="Silver"
fill="{sc2}"
stroke="{s2}"
/>
<mx:ColumnSeries
xField="Country"
yField="Bronze"
displayName="Bronze"
fill="{sc3}"
stroke="{s3}"
/>
</mx:series>
</mx:ColumnChart>
<mx:Legend dataProvider="{column}"/>
<mx:BarChart id="bar" height="100%" width="45%"
paddingLeft="5" paddingRight="5"
showDataTips="true" dataProvider="{medalsAC}">
<mx:verticalAxis>
<mx:CategoryAxis categoryField="Country"/>
</mx:verticalAxis>
<mx:series>
<mx:BarSeries
yField="Country"
xField="Gold"
displayName="Gold"
fill="{sc1}"
stroke="{s1}"
/>
<mx:BarSeries
yField="Country"
xField="Silver"
displayName="Silver"
fill="{sc2}"
stroke="{s2}"
/>
<mx:BarSeries
yField="Country"
xField="Bronze"
displayName="Bronze"
fill="{sc3}"
stroke="{s3}"
/>
</mx:series>
</mx:BarChart>
<mx:Legend dataProvider="{bar}"/>
</mx:Panel>
</mx:Application> |
Est ce que qq'un à une idée d'où vient mon problème ?