有人可以给我一个ColumnSeries的itemRenderer的代码,目前我的最大努力如下......
定义itemRenderer
columnSeries.setStyle("itemRenderer","comp.EmptyBox");
comp.EmptyBox
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
focusEnabled="true">
<s:Rect id="lblData" top="0" left="0" right="0" bottom="0">
<s:fill>
<s:SolidColor color="0xFFFFCC" />
</s:fill>
<s:stroke>
<s:SolidColorStroke color="0x660099" weight="2" />
</s:stroke>
</s:Rect>
目前我的错误是由于构造错误的itemRenderer而导致的类型cohersion。
答案 0 :(得分:1)
试试这个:
columnSeries.setStyle("itemRenderer", new ClassFactory(comp.EmptyBox));