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
| <?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var algo1:Array = [
{Prop:"precision", pourcents:80},
{Prop:"rcall", pourcents:50},
{Prop:"fmeas", pourcents:75}
];
[Bindable]
public var algo2:Array = [
{Prop:"precision", pourcents:90},
{Prop:"rcall", pourcents:80},
{Prop:"fmeas", pourcents:85}
];
public var aucun : Array =[
{Prop:"precision", pourcents:0},
{Prop:"rcall", pourcents:0},
{Prop:"fmeas", pourcents:0}
];
]]></mx:Script>
<!-- Define custom colors for use as column fills. -->
<mx:SolidColor id="sc1" color="blue" alpha=".3"/>
<mx:SolidColor id="sc2" color="red" alpha=".3"/>
<!-- Define custom Strokes for the columns. -->
<mx:Stroke id="s1" color="blue" weight="2"/>
<mx:Stroke id="s2" color="red" weight="2"/>
<mx:SeriesSlide
id="slideIn"
duration="1500"
direction="up"
/>
<mx:SeriesSlide
id="slideOut"
duration="1500"
direction="down"
/>
<mx:Panel title="Test Column Chart">
<mx:ColumnChart id="myChart" showDataTips="true">
<mx:horizontalAxis>
<mx:CategoryAxis categoryField="Prop"/>
</mx:horizontalAxis>
<mx:series>
<mx:ColumnSeries
yField="pourcents"
xField="Prop"
displayName="algo"
fill="{sc1}"
stroke="{s1}"
showDataEffect="slideIn"
hideDataEffect="slideOut"
/>
<!--<mx:ColumnSeries
dataProvider="{algo2}"
yField="pourcents"
xField="Prop"
displayName="algo2"
fill="{sc2}"
stroke="{s2}"
showDataEffect="slideIn"
hideDataEffect="slideOut"
/>-->
</mx:series>
</mx:ColumnChart>
<mx:Legend dataProvider="{myChart}"/>
</mx:Panel>
<mx:VBox>
<mx:CheckBox label="algo 1" activate="myChart.dataProvider=algo1;" deactivate="myChart.dataProvider=aucun;"/>
<mx:CheckBox label="algo 2" activate="myChart.dataProvider=algo2;" deactivate="myChart.dataProvider=aucun;"/>
</mx:VBox>
</mx:Application> |
Partager