Mega Code Archive
Define a custom component inline by using the fx
tag." src="http://www.rntsoft.com/Code/FlexImages/DefineacustomcomponentinlinebyusingthefxComponenttag.PNG"
import mx.collections.ArrayCollection;
import mx.charts.ColumnChart;
[Bindable]
private var ac:ArrayCollection;
public function setupDP():void{
ac = new ArrayCollection([
[ "Label 1 is short.", 200000],
[ "Label 2 is a fairly long label.", 150000],
[ "Label 3 is an extremely long label. It contains 95 characters and will likely be truncated.", 40000]
]);
}
[Bindable]
private var myTip:String;
override public function set data(value:Object):void{
if(value == null)
return;
myTip = value.text;
var length:int = value.text.toString().length;
if (length > 20) {
text = value.text.toString().substr(0, 20) + "...";
} else {
text = value.text;
}
}