views:

405

answers:

1

Hi all,

I have a Flex Column Chart, which shows bars with each positive and negative values. I only want to have a horizontal line at 0 to distinguish between positive and negative values.

I turned off all the axis.

How could I achieve to get this line?

Thanks, Martin

+1  A: 

The easiest way is to add a GridLines instance to the backgroundElements array property of your chart:

<mx:backgroundElements>
               <mx:GridLines 
                 direction="horizontal" 
                 horizontalShowOrigin="true"
                 horizontalChangeCount="{int.MAX_VALUE}">

                    <mx:horizontalOriginStroke>
                     <mx:Stroke weight="1" />
                    </mx:horizontalOriginStroke>

                </mx:GridLines>
            </mx:backgroundElements>

Alternatively, rather than setting the horizontalChangeCount to a huge value, you could use a horizontal stroke that is invisible (alpha = 0 or somesuch).

stephen