Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache flex 灵活柱状图定制_Apache Flex_Charts_Legend - Fatal编程技术网

Apache flex 灵活柱状图定制

Apache flex 灵活柱状图定制,apache-flex,charts,legend,Apache Flex,Charts,Legend,当我通过重写updateDisplayList函数在Flex中定制柱形图时,图例中的颜色不再显示。如下图所示: 我错过什么了吗 谢谢。如果您想查看源代码,以下是我所做的 覆盖保护功能 updateDisplayListunscaledWidth:Number,unscaledHeight:Number:void { super.updateDisplayListunscaledWidth,unscaledHeight var fill:IFill; var sta

当我通过重写updateDisplayList函数在Flex中定制柱形图时,图例中的颜色不再显示。如下图所示:

我错过什么了吗


谢谢。

如果您想查看源代码,以下是我所做的

覆盖保护功能 updateDisplayListunscaledWidth:Number,unscaledHeight:Number:void { super.updateDisplayListunscaledWidth,unscaledHeight

        var fill:IFill;
        var state:String = "";

        if (_data is ChartItem && _data.hasOwnProperty('fill'))
        {
            state = _data.currentState;
            fill = _data.fill;
        }       
        else
            fill = GraphicsUtilities.fillFromStyle(getStyle('fill'));

        var color:uint;
        var adjustedRadius:Number = 0;

        color = ColorUtil.adjustBrightness2(GraphicsUtilities.colorFromFill(fill),-20);
        fill = new SolidColor(color);       
        adjustedRadius = getStyle('adjustedRadius');
        if (!adjustedRadius)
            adjustedRadius = 0;


        var stroke:IStroke = getStyle("stroke");

        var w:Number = stroke ? stroke.weight / 2 : 0;

        var rc:Rectangle = new Rectangle(w - adjustedRadius, w - adjustedRadius, width - 2 * w + adjustedRadius * 2, height - 2 * w + adjustedRadius * 2);

        var g:Graphics = graphics;
        g.clear();      
        g.moveTo(rc.left,rc.top);
        if (stroke)
            stroke.apply(g);
        if (fill)
            fill.begin(g,rc);
        g.lineTo(rc.right-5,rc.top);
        g.lineTo(rc.right-5,rc.bottom);
        g.lineTo(rc.left+5,rc.bottom);
        g.lineTo(rc.left+5,rc.top);
        if (fill)
            fill.end(g);

}

您可以使用legendMarkerRenderer设置图例标记的格式。这篇文章向您展示了如何向底部移动:

您还可以通过创建自己的LegendItem来定制LegendItem:

自定义图例的示例: