4

I am using the Flex ColumnChart with multiple ColumnSeries. I want to add space between the ColumnSeries bars/columns.

What do I mean? If you look at the Adobe LiveDocs for ColumnChart, I have a chart similar to the 1st chart. I want to add margin/padding between the orange and green columns (not the months).

alt text

I've looked through the LiveDocs and I can't find anything on it.

jsalwen
  • 569
  • 4
  • 9

2 Answers2

1

you need to play around with y coordinate of second series. I wrote you an example how you can achieve to control the distance between several series. This is not perfect but hopefully shows you the right way how to do it ;)

http://pastie.org/3327210

enter image description here

Frank Szilinski
  • 550
  • 1
  • 5
  • 18
0

Subclassing mx.charts.series.ColumnSet worked perfectly for me (at least in 4.0 sdk)

public class TestColumnSet extends ColumnSet 
{                   
    public var intraSetMaxColumnWidth:Number = NaN;
    public var intraSetColumnWidthRatio:Number = NaN;

    override protected function customizeSeries(glyph:IChartElement,i:uint):void
    {
        super.customizeSeries(glyph, i);            
        var currentSeries:IColumn = IColumn(glyph);         

        if(!isNaN(intraSetColumnWidthRatio))
            currentSeries.columnWidthRatio = intraSetColumnWidthRatio;          
        if(!isNaN(intraSetMaxColumnWidth))
            currentSeries.maxColumnWidth = intraSetMaxColumnWidth;      
    }   
 }

used like that:

var cs:TestColumnSet = new TestColumnSet();
...
cs.intraSetColumnWidthRatio = cs.columnWidthRatio/cs.series.length*(1-desiredSpaceRatio);