xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark" height="600">
import mx.formatters.NumberFormatter;
import mx.charts.chartClasses.IAxisRenderer;
import mx.collections.ArrayCollection;
private function CMstoInches(ar:IAxisRenderer, strCMs:String):String {
var n:NumberFormatter = new NumberFormatter();
n.precision = 1;
return n.format((Number(strCMs) * 0.393700787).toString());
}
[Bindable]
private var SampleHeightData:ArrayCollection = new ArrayCollection([
{ Age: "Birth", height: 53},
{ Age: "3", height: 57 },
{ Age: "6", height: 64 },
{ Age: "9", height: 70 },
{ Age: "12", height: 82 },
{ Age: "15", height: 88 }
]);
[Bindable]
private var HeightData:ArrayCollection = new ArrayCollection([
{ Age: "Birth", 5: 52, 10: 53, 25:54, 50:58, 75:60, 90:62, 95:63 },
{ Age: "3", 5: 56, 10: 57, 25:58, 50:62, 75:64, 90:66, 95:67 },
{ Age: "6", 5: 62, 10: 63, 25:64, 50:68, 75:70, 90:72, 95:73 },
{ Age: "9", 5: 66, 10: 67, 25:68, 50:72, 75:74, 90:76, 95:77 },
{ Age: "12", 5: 70, 10: 71, 25:72, 50:76, 75:80, 90:82, 95:83 },
{ Age: "15", 5: 74, 10: 75, 25:76, 50:80, 75:84, 90:86, 95:87 }
]);
title="Multiple Axis Example, Boys: Age - Height percentiles"
height="100%" width="100%">
paddingLeft="5" paddingRight="5" showDataTips="true"
dataProvider="{HeightData}">
title="Age in Months" ticksBetweenLabels="false" />
baseAtZero="false" />
labelFunction="CMstoInches" highlightElements="true" />
displayName="10%" />
displayName="25%" />
displayName="50%" />
displayName="75%" />
displayName="90%" />
displayName="95%" />
dataProvider="{SampleHeightData}" yField="height"
fills="{[0xCC6600]}" />