One idea - don't bind your legend to your chart. Create your own
legend. To get the color, query your series fill style (once both
series have initially been created), or just use the Halo colors
array. An example:
for (var i:int = 0; i < array.length; i++) {
var color:uint;
var legItem:LegendItem = new LegendItem();
legend.addChild(legItem);
legItem.label = array[i]
legItem.setStyle("fill", determineYourColorHere...)
legItem.setStyle("fontSize", 12);
}
-Eddie
--- In [email protected], "Sefi Ninio" <[EMAIL PROTECTED]> wrote:
>
> Some more info:
> The legend wasn't there at all, and when I debugged the app, I caught an
> Error:
> ReferenceError: Error #1069: Property marker not found on
> com.innovid.view.common.LineSeries and there is no default value.
> Probably because it's a member of the chart itself and not of the
series...
>
> On Sat, Nov 22, 2008 at 10:56 AM, Sefi Ninio <[EMAIL PROTECTED]> wrote:
>
> > Hey,
> >
> > I have a chart with two series, but one has values a lot bigger
than the
> > other (avg of ~3000 against ~4), so the second series's values are
almost
> > not visible...
> > Setting the big series's visibility to false doesn't cause the
chart to
> > redraw to show the small series since the big series is still
there, just
> > not visible.
> > I'd like to implement a mechanism, that when clicking on the
series item in
> > the legend, the series is removed from the chart and clicking on
it again
> > will add it again
> >
> > I implemented logic that on click on a legend item, it removes the
clicked
> > series from the chart's dataProvider and stores it in backup
arrayCollection
> > to be able to put it back when the legend item is clicked again.
This works
> > and the chart rescales to view the small series just fine.
> >
> > The problem is, that when I remove a series from the chart, it is also
> > removed from the legend (since it's dataProvider is bound to the chart
> > itself) and I can't get it back in there since there's nothing to
click
> > on...
> >
> > So, I tried to bound the legend to a function that returns an
> > arrayCollection which has it's source set to the combined series
from the
> > chart series array and the removed series array. This didn't work
and the
> > legend wasn't there at all...
> >
> > Any ideas anyone?
> >
> > Thanks,
> > Sefi
> >
>