Flex: line chart backgroundelement color (use grid as an example)

Source: Internet
Author: User
<? 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 >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.