代码之家  ›  专栏  ›  技术社区  ›  Jonny

虚线式折线图网格线

  •  1
  • Jonny  · 技术社区  · 15 年前

    使用Flex的LineChart组件:如何使水平网格线(图表中的背景)虚线化?使用mx:horizontalStroke中的mx:Stroke,我只能设置诸如weight、color和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 回复  |  直到 15 年前
        1
  •  -1
  •   aravinda    14 年前

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

    并使用此函数来main.mxml文件

    专用函数drawline(argStr:String):void { var s:Shape=新点线(1.5,Chart.height,0xff0000,1,5,4); uil=新的UIComponent(); uil.addChild(s); uil.height=图表高度; canChart.addDataChild(uil,argStr,空,空,空,argStr,50); }

    推荐文章