0
누구든지 차트 데이터 형식으로 이미지를 추가하는 방법을 알 수 있습니까?플렉스 차트 itemrenderers 3
누구든지 차트 데이터 형식으로 이미지를 추가하는 방법을 알 수 있습니까?플렉스 차트 itemrenderers 3
datatip의 하위 클래스를 만들고 updateDisplayList 함수를 재정의해야합니다. 여기
내가 무슨 짓을 :override protected function updateDisplayList(w:Number, h:Number):void {
super.updateDisplayList(w, h);
this.setStyle("textAlign","left");
this.setStyle("color", "0xCCCCCC");
if (this.numChildren > 1)
this.removeChildAt(1);
numLines = (data.displayText as String).split("<br").length;
var g:Graphics = graphics;
g.clear();
var m:Matrix = new Matrix();
m.createGradientBox(w+60,h+numLines*25,0,0,0);
g.beginGradientFill(GradientType.LINEAR,[0x00FF00,0xFFFFFF],
[.1,1],[0,255],m,null,null,0);
g.drawRect(-30,0,w+60,h+numLines*25);
g.endFill();
// load current image
var imageFile:File = File.applicationStorageDirectory.resolvePath(Constants.TINY_IMG_PATH + data.item.name);
var urlLoader:URLLoader = new URLLoader();
urlLoader.dataFormat = URLLoaderDataFormat.BINARY;
urlLoader.addEventListener(Event.COMPLETE, onLoadingComplete);
urlLoader.load(new URLRequest(imageFile.nativePath));
}
private function onLoadingComplete(e: Event):void
{
var dispLoader: Loader = new Loader();
dispLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onParsingComplete);
dispLoader.loadBytes(e.currentTarget.data);
}
private function onParsingComplete(e:Event):void {
var container:Sprite = new Sprite();
this.addChild(container);
container.y = numLines*15 + 10;
var _bitmap:Bitmap = new Bitmap((e.currentTarget.content as Bitmap).bitmapData);
container.graphics.beginBitmapFill(_bitmap.bitmapData, null, false, true);
container.graphics.drawRect(0, 0, _bitmap.width, _bitmap.height);
container.graphics.endFill();
}
이
을 즐길 수