zoukankan      html  css  js  c++  java
  • Flex 学习笔记 LineChart双坐标

    如何实现纵坐标左右两边都绑定数据显示呢,实现代码如下

    AS

        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                
                [Bindable] 
                private var monthData:ArrayCollection=new ArrayCollection([                 
                    {xname:'1月',yname:2000,y2name:800},                 
                    {xname:'2月',yname:1000,y2name:500},                 
                    {xname:'3月',yname:3000,y2name:700},                 
                    {xname:'4月',yname:1000,y2name:800},                 
                    {xname:'5月',yname:1300,y2name:800}]); 
                            
                [Bindable] 
                private var monthGrowData:ArrayCollection=new ArrayCollection([ 
                    {xname:'1月',y3name:1000,y4name:60},             
                    {xname:'2月',y3name:1200,y4name:100},                 
                    {xname:'3月',y3name:4300,y4name:800},                 
                    {xname:'4月',y3name:200,y4name:800},                 
                    {xname:'5月',y3name:2700,y4name:800}]); 
            ]]>
        </fx:Script>

    MXML

        <mx:LineChart showDataTips="true" dataProvider="{monthData}" secondDataProvider="{monthGrowData}">        
            <mx:horizontalAxis>
                <mx:CategoryAxis categoryField="xname"/>
            </mx:horizontalAxis>
            <mx:series>
                <mx:LineSeries yField="yname" />
                <mx:LineSeries yField="y2name" />
            </mx:series>
            
            <mx:secondSeries>
                <mx:LineSeries yField="y3name" />
                <mx:LineSeries yField="y4name" />
            </mx:secondSeries>
        </mx:LineChart>

    如果纵坐标只绑定一列数据的话,可以参考下面的代码(下面转载,收藏下,O(∩_∩)O哈!)

    http://justcode.w.blog.163.com/blog/static/11430304820115411233290/

  • 相关阅读:
    Docker
    Web
    爬虫
    Python
    软件脱壳
    网络抓包
    HTTPS单向认证,双向认证
    新版无完整背景图片滑块验证码
    Frida Hook
    闭包函数与装饰器
  • 原文地址:https://www.cnblogs.com/Anlycp/p/2590652.html
Copyright © 2011-2022 走看看