Adding LegendItems in Flex places horizontally not vertically (as it's supposed to)
- by David
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.