zoukankan      html  css  js  c++  java
  • Flex : Line Chart BackgroundElement color (结合Grid做网格线的例子)

    <?xml version="1.0"?> 
    <!-- charts/BasicLine.mxml --> 
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" 
    height
    ="100%"> 
      
    <mx:Script><![CDATA[ 
         import mx.collections.ArrayCollection; 
         [Bindable] 
         public var expenses:ArrayCollection = new ArrayCollection([ 
            {Month:"Jan", Profit:2000, Expenses:1500, Amount:450}, 
            {Month:"Feb", Profit:1000, Expenses:200, Amount:600}, 
            {Month:"Mar", Profit:1500, Expenses:500, Amount:300} 
         ]); 
      
    ]]></mx:Script> 
      
    <mx:Panel title="Line Chart" width="100%" height="100%"> 
         
    <mx:LineChart id="myChart" dataProvider="{expenses}" 
    showDataTips
    ="true" width="100%" height="100%"> 


            
    <mx:backgroundElements> 
                            
    <mx:Grid height="100%" width="100%" verticalGap="0"> 
                                    
    <mx:GridRow height="20%" width="100%"> 
                                            
    <mx:GridItem height="100%" width="100%"> 
                                                    
    <mx:Canvas height="100%" width="100%" alpha="0.7" 
    backgroundColor
    ="#1dae00" /> 
                                            
    </mx:GridItem> 
                                    
    </mx:GridRow> 
                                    
    <mx:GridRow height="20%" width="100%"> 
                                            
    <mx:GridItem height="100%" width="100%"> 
                                                    
    <mx:Canvas height="100%" width="100%" alpha="0.7" 
    backgroundColor
    ="#ffa800" /> 
                                            
    </mx:GridItem> 
                                    
    </mx:GridRow> 
                                    
    <mx:GridRow height="20%" width="100%"> 
                                            
    <mx:GridItem height="100%" width="100%"> 
                                                    
    <mx:Canvas height="100%" width="100%" alpha="0.7" 
    backgroundColor
    ="#ff0000" /> 
                                            
    </mx:GridItem> 
                                    
    </mx:GridRow> 
                                    
    <mx:GridRow height="20%" width="100%"> 
                                            
    <mx:GridItem height="100%" width="100%"> 
                                                    
    <mx:Canvas height="100%" width="100%" alpha="0.7" 
    backgroundColor
    ="#d65f48" /> 
                                            
    </mx:GridItem> 
                                    
    </mx:GridRow> 
                                    
    <mx:GridRow height="20%" width="100%"> 
                                            
    <mx:GridItem height="100%" width="100%"> 
                                                    
    <mx:Canvas height="100%" width="100%" alpha="0.7" 
    backgroundColor
    ="#cfc505" /> 
                                            
    </mx:GridItem> 
                                    
    </mx:GridRow> 
                            
    </mx:Grid> 
                    
    </mx:backgroundElements> 


            
    <mx:horizontalAxis> 
               
    <mx:CategoryAxis dataProvider="{expenses}" 
    categoryField
    ="Month" /> 
            
    </mx:horizontalAxis> 
            
    <mx:series> 
               
    <mx:LineSeries yField="Profit" displayName="Profit" /> 
               
    <mx:LineSeries yField="Expenses" displayName="Expenses" /> 
            
    </mx:series> 
         
    </mx:LineChart> 
         
    <mx:Legend dataProvider="{myChart}"/> 
      
    </mx:Panel> 
    </mx:Application>
  • 相关阅读:
    WPF中的控件布局
    [转]WPF, WPF/E释疑
    创建像Vista任务栏一样的半透明玻璃按钮
    WPF中的TextBlock
    .net 2.0 文档生成工具
    XNA Game Studio Express 1.0正式版 发布
    WPF免费视频教程,来自Lynda.com
    WPF中的ControlTemplate(控件模板)
    获奖啦, 微软亚洲研究院第九届学生实践项目
    [转]让用户通过宏和插件向您的 .NET 应用程序添加功能
  • 原文地址:https://www.cnblogs.com/Fooo/p/1587795.html
Copyright © 2011-2022 走看看