Hi cancerinform,
Yes the icons are outside because I'm still testing. I'm struggling on with the width issue. My idea now is that if I can get the maximum width of the pyramid I can calculate the 0 position. But after hours of trying I would like to ask the advice of the forum again. I thought it would be simple. In the itemRenderer I've made a variable called pyramidMaxWidth set to 0. When the data comes in I want to compare the new data with the pyramidMaxWidth value and when the new data is bigger I update pyramidMaxWidth. This is the code:
PHP Code:
[Bindable] private var pyramidMaxWidth:Number 0;

override public function set data(value:Object):void{
                 
super.data value;
                
trace("x oud:"+pyramidMaxWidth);
                
trace("pop: "+Number(value.pop)*9);
                
                if(
Number(value.pop)*pyramidMaxWidth){
                    
pyramidMaxWidth Number(value.pop)*9;
                    
trace("x:"+pyramidMaxWidth);
                }
            } 
This is the trace result:
x oud:0
pop: 10.6632
x:10.6632
x oud:0
pop: 262.2582
x:262.2582
x oud:0
pop: 566.8569
x:566.8569
x oud:0
pop: 527.0337
x:527.0337
x oud:0
pop: 443.4039
x:443.4039
x oud:0
pop: 609.2946
x:609.2946
x oud:0
pop: 139.3767
x:139.3767
x oud:0
pop: 304.2351
x:304.2351
x oud:0
pop: 492.4953
x:492.4953
x oud:0
pop: 1.9404000000000001
x:1.9404000000000001
x oud:0
pop: 451.56149999999997
x:451.56149999999997
x oud:0
pop: 552.5784
x:552.5784
x oud:0
pop: 35.6733
x:35.6733
x oud:0
pop: 597.0645000000001
x:597.0645000000001
x oud:0
pop: 425.70540000000005
x:425.70540000000005
x oud:0
pop: 415.2879
x:415.2879
x oud:0
pop: 351.2133
x:351.2133
x oud:0
pop: 413.5905
x:413.5905
x oud:0
pop: 213.5394
x:213.5394
x oud:0
pop: 82.28790000000001
x:82.28790000000001

So when data comes in I compare it but somehow the pyramidMaxWidth value is set to zero with every loop. I'm at my wits end, how difficult can this be? I've also tried the same code in the dataChange event but the result is the same. I've also tried sorting an ArrayCollection but somehow the same thing is repeated and I always get the last value that comes in...

Hope someone can help, I'll be eternally grateful.