Feb
17
2011
I want customize the legend, put a delete button on each legend item, click the button and easily remove the corresponding series from the chart.
I define legendMarkerRenderer style of the series with the custom legend item marker to achieve this: each custom marker is a button object, replace the original marker with the a rectangle as the background, then add two cross lines on the background. To position easily, I center align them. See CloseBtnSkin.mxml if you are interested.
As we all know, we can specifies the marker portion of the legend item with the labelPlacement style. Recognized values are "top", "bottom", "left", and "right". When sets the value to "left",The two cross lines on the button disppear,and the button mode isn't the display of the hand cursor. Unless we set the size of the legend item marker is large enough and put the mouse over the top of the marker,which can work.
If we set the labelPlacement style to other values, there is no issue,which should be one bug of Legend.
View the demo, Download the source code.
原文:http://www.riafan.com/article/flex/flex-chart-legend-bug.html