flex图表网格线点缀

时间:2009-11-27 07:57:48

标签: flex charts

使用Flex的LineChart组件:如何使水平网格线(图表中的背景)点缀?使用mx:horizo​​ntalStroke中的mx:Stroke,我只能设置权重,颜色和alpha等属性。我想把线条点缀......

这就是我现在所拥有的:

<mx:LineChart id="linechartDays" width="100%" height="100%" dataProvider="{dayData}" showDataTips="true">
    <mx:backgroundElements>
        <mx:GridLines horizontalChangeCount="1" direction="horizontal">
            <mx:horizontalStroke>
                <mx:Stroke weight="1" color="0xcccccc"/>
            </mx:horizontalStroke>
        </mx:GridLines>
    </mx:backgroundElements>
</mx:LineChart>

1 个答案:

答案 0 :(得分:-1)

将DottedLine.as类文件用于以下路径http://www.warmforestflash.com/blog/2009/01/as3-dotted-line-class/

并将此函数用于main.mxml文件

私有函数drawline(argStr:String):void {           var s:Shape = new DottedLine(1.5,Chart.height,0xff0000,1,5,4);       uil = new UIComponent();       uil.addChild(一个或多个);       uil.height = Chart.height;       canChart.addDataChild(UIL,argStr,NULL,NULL,NULL,argStr,50); }