Flex achieves dual-axis stripe chart and flex dual-axis stripe chart

Source: Internet
Author: User

Flex achieves dual-axis stripe chart and flex dual-axis stripe chart

1. Problem background

Generally, a bar chart can be a dual-axis chart, but how can it be a dual-axis graph?


2. Implementation instance

<? Xml version = "1.0" encoding = "UTF-8"?> <S: Application xmlns: fx = "http://ns.adobe.com/mxml/2009" xmlns: s = "library: // ns.adobe.com/flex/spark" xmlns: mx = "library: // ns.adobe.com/flex/mx "width =" 100% "height =" 100% "creationComplete =" initHandler (event) "> <s: layout> <s: BasicLayout/> </s: layout> <fx: Script> <! [CDATA [import mx. collections. arrayCollection; import mx. events. flexEvent; [Bindable] private var chartArray: ArrayCollection = new ArrayCollection ([{week: "Monday", snake: "5459", cow: "7845" },{ week: "Tuesday", snake: "8956", cow: "7845" },{ week: "Wednesday", snake: "3562", cow: "7845" },{ week: "Thursday", snake: "7856", cow: "7845" },{ week: "Friday", snake: "1245", cow: "7845" },{ week: "Saturday", snake: "9656", cow: "7845" },{ week: "Sunday", snake: "6784", cow: "7845" }]); Protected function initHandler (event: FlexEvent): void {cate. ticksBetweenLabels = false;}]> </fx: Script> <fx: Declarations> <! -- Place non-visual elements (such as services and value objects) Here --> </fx: Declarations> <mx: VBox width = "100%" height = "100%" horizontalAlign = "center" paddingBottom = "10" paddingLeft = "10" paddingRight = "20" paddingTop = "10"> <mx: barChart id = "barchart" width = "100%" height = "90%" showDataTips = "true" dataProvider = "{chartArray}"> <mx: verticalAxis> <mx: categoryAxis id = "cate" categoryField = "week" displayName = "week"/> </mx: verticalAxis> <mx: series> <mx: barSeries displayName = "snake quantity" xField = "snake" yField = "week"/> </mx: series> <mx: secondVerticalAxis> <mx: categoryAxis categoryField = "week" displayName = ""/> </mx: secondVerticalAxis> <mx: secondSeries> <mx: lineSeries displayName = "" xField = "cow" yField = "week"/> </mx: secondSeries> </mx: BarChart> <mx: legend dataProvider = "{barchart}"/> </mx: VBox> </s: Application>

3. Implementation result



The Y axis of the Flex bar chart is displayed.

Many components of projects that can be implemented cannot be applied. Therefore, developers can expand their own components!

How to associate Flex with the double X axis

The Cluster Column in axiis is implemented and you can plot it yourself.

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.