Adding LegendItems in Flex places horizontally not vertically (as it's supposed to)
Posted
by David
on Stack Overflow
See other posts from Stack Overflow
or by David
Published on 2009-04-25T00:55:16Z
Indexed on
2010/03/18
12:11 UTC
Read the original article
Hit count: 353
I'm dynamically inserting LegendItems into a Legend using the following code:
signalLegend.removeAllChildren();
signalLegend.direction = "vertical";
for (var i:int = 0; i < numItems - 1; i++) {
signalLegend.addChild(new LegendItem());
legendItem = signalLegend.getChildAt(i) as LegendItem;
legendItem.label = "Title here";
legendItem.setStyle("fill", theColour);
}
While the Legend direction is set as vertical, all the items are appearing horizontally.
Very annoying.
© Stack Overflow or respective owner