Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9166975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:16:46+00:00 2026-06-17T15:16:46+00:00

I have a column chart in flex that has quite a few columns, the

  • 0

I have a column chart in flex that has quite a few columns, the user can choose to display in column order or overlaid. Depending on the users screen it makes the chart more readable.
However, is then any call I can make to have the overlay order change depending on the data. i.e. Largest data column a the back, overlaid by the next largest so on and so fourth until the smallest column is on top.
Currently default behavior some of the small columns are obscured by the larger columns, I don’t want to change alpha values to do this. (first of all thanks to flashharry! as
I have seen this question 2-3 times in some discussion forums, but not answered any where). Is this possible in flex column chart???

Any help would be immensely appreciated.

Thanks in advance..

@Serge Him

Code sample:- in the below code the profit of last two months are lesser than expense, so we cannot see the series as it is behind the expense series. I want the greater value will be always behind lesser value

<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">
    <fx:Script>
        <![CDATA[

            import mx.collections.ArrayCollection;
            [Bindable]
            public var expenses:ArrayCollection = new ArrayCollection([
                {Month:"Jan", Profit:2000, Expenses:1500},
                {Month:"Feb", Profit:1000, Expenses:200},
                {Month:"Mar", Profit:1100, Expenses:500},
                {Month:"Apr", Profit:1300, Expenses:900},
                {Month:"May", Profit:900, Expenses:1200},
                {Month:"June", Profit:1500, Expenses:2500}
            ]);


        ]]>
    </fx:Script>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>

    <s:BorderContainer width="100%" height="100%" >
        <s:layout>
            <s:VerticalLayout horizontalAlign="center"/>
        </s:layout>
        <mx:ColumnChart id="myChart" width="65%"
                      dataProvider="{expenses}" 
                      showDataTips="true" 
                      type="overlaid"
                      >
            <mx:horizontalAxis>
                <mx:CategoryAxis 
                    dataProvider="{expenses}" 
                    categoryField="Month"
                    />
            </mx:horizontalAxis>
            <mx:series>
                <mx:ColumnSeries 
                    yField="Profit" 
                    displayName="Profit"
                    >
                    <mx:fill>
                        <s:SolidColor color="0x00ff00"/>
                    </mx:fill>
                    </mx:ColumnSeries>
                <mx:ColumnSeries 
                    yField="Expenses"
                    displayName="Expenses"
                    >
                    <mx:fill>
                        <s:SolidColor color="0xff0000"/>
                    </mx:fill>
                    </mx:ColumnSeries>
            </mx:series>
        </mx:ColumnChart>
        <mx:Legend dataProvider="{myChart}"/>
        <mx:DataGrid dataProvider="{expenses}" editable="true">
            <mx:columns>
                <mx:DataGridColumn dataField="Month" editable="true"/>
                <mx:DataGridColumn dataField="Profit" editable="true"/>
                <mx:DataGridColumn dataField="Expenses" editable="true"/>
            </mx:columns>
        </mx:DataGrid>
    </s:BorderContainer>
</s:Application>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:16:47+00:00Added an answer on June 17, 2026 at 3:16 pm

    I’ve studied your problem, deeping in initializing ColumnChart component. There is a feature, that all columns from series is placed in separate layer. So, either green columns are on the top or red. No posibility to change parent of one column from series…I’m afraid you have to override the basic behavior of component and place all columns in the same container and sort their depths. I drew an example:

    <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="900" height="600">
        <fx:Script>
            <![CDATA[
                import mx.charts.series.items.ColumnSeriesItem;
                import mx.collections.ArrayCollection;
    
                [Bindable]
                public var expenses:ArrayCollection = new ArrayCollection([
                    {Month:"Jan", Profit:200, Expenses:100, Expenses2:50},
                    {Month:"Feb", Profit:1000, Expenses:2000, Expenses2:500},
                    {Month:"Mar", Profit:1100, Expenses:500, Expenses2:100},
                    {Month:"Apr", Profit:1300, Expenses:900, Expenses2:1000},
                    {Month:"May", Profit:900, Expenses:1200, Expenses2:1000},
                    {Month:"June", Profit:1000, Expenses:2000, Expenses2:1500}
                ]);
    
                private var items:Array = [];
    
                private function init():void
                {
                    items = [];
                    for (var i:int=0; i<myChart.series.length; i++)
                    {
                        var series:ColumnSeries = myChart.series[i] as ColumnSeries;
                        for (var j:int=0; j<series.items.length; j++)
                        {
                            if (!items[j])
                                items[j] = [];
    
                            var item:ColumnSeriesItem = series.items[j] as ColumnSeriesItem;
                            items[j][i] = item;
                            series.parent.addChild(item.itemRenderer as DisplayObject);
                        }
                    }
                    sort();
                }
    
                private function sort():void
                {
                    var h:Number = myChart.height - 50;
                    for (var i:int=0; i<items.length; i++)
                    {
                        var group:Array = items[i];
                        group.sort(sortFunction);
                        for (var j:int=0; j<group.length; j++)
                        {
                            var item:ColumnSeriesItem = group[j] as ColumnSeriesItem;
                            item.itemRenderer.parent.setChildIndex(item.itemRenderer as DisplayObject, group.length - j - 1);
                            item.min = NaN;
                            if (j > 0)
                                item.min = h - group[j-1].itemRenderer.height;
                        }
                    }
                }
    
                private function sortFunction(item1:ColumnSeriesItem, item2:ColumnSeriesItem):int 
                {
                    var yValue1:int = item1.item[Object(item1.element).yField];
                    var yValue2:int = item2.item[Object(item2.element).yField];
                    return (yValue1 < yValue2) ? -1 : (yValue1 > yValue2) ? 1 : 0;
                }
            ]]>
        </fx:Script>
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
    
        <s:BorderContainer width="100%" height="100%" >
            <s:layout>
                <s:VerticalLayout horizontalAlign="center"/>
            </s:layout>
            <mx:ColumnChart id="myChart" width="65%"
                            dataProvider="{expenses}" 
                            showDataTips="true" 
                            type="overlaid"
                            updateComplete="init()"
                            >
                <mx:horizontalAxis>
                    <mx:CategoryAxis 
                        dataProvider="{expenses}" 
                        categoryField="Month"
                        />
                </mx:horizontalAxis>
                <mx:series>
                    <mx:ColumnSeries
                        yField="Profit" 
                        displayName="Profit"
                        >
                        <mx:fill>
                            <s:SolidColor color="0x00ff00"/>
                        </mx:fill>
                    </mx:ColumnSeries>
                    <mx:ColumnSeries 
                        yField="Expenses"
                        displayName="Expenses"
                        >
                        <mx:fill>
                            <s:SolidColor color="0xff0000"/>
                        </mx:fill>
                    </mx:ColumnSeries>
                    <mx:ColumnSeries 
                        yField="Expenses2"
                        displayName="Expenses2"
                        >
                        <mx:fill>
                            <s:SolidColor color="0xffff00"/>
                        </mx:fill>
                    </mx:ColumnSeries>
                </mx:series>
            </mx:ColumnChart>
            <mx:Legend dataProvider="{myChart}"/>
            <mx:DataGrid dataProvider="{expenses}" editable="true">
                <mx:columns>
                    <mx:DataGridColumn dataField="Month" editable="true"/>
                    <mx:DataGridColumn dataField="Profit" editable="true"/>
                    <mx:DataGridColumn dataField="Expenses" editable="true"/>
                    <mx:DataGridColumn dataField="Expenses2" editable="true"/>
                </mx:columns>
            </mx:DataGrid>
        </s:BorderContainer>
    </s:Application>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this column chart that has 2 modes, monthly visualization and yearly visualization,
I have to do a column chart using highcharts that has 1px space between
I have a neat chart that is rendering overlaid columns with values in excess
I have to display a column chart in a user form in VBA. Exporting
In phpMyAdmin I have a char(32) column that has no default value(ie. Default: None).
I have a wpf column series chart and I have more than 15 columns.
I'm trying to build a column chart that has groups it's data by quarter,
I need to create a column chart from values that I have stored in
I have VBA code that I wrote that creates an Excel Column Cluster chart
I have a column chart that I made using Adobe Flash Builder. I'd like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.