[flexcoders] Re: Possible to change the Fill Color for ColumnSeries on itemRollOver?

2009-07-09 Thread Tim Hoff

Ha, yeah if it works you get extra points. :) I tried using the chart's
itemRollOver event, but ran into a snafu trying to drill down and change
the fill of the BoxItemRenderer.  It seems to have a getStyle method,
but no setStyle().  Got past that, but the stroke style got me.  Would
probably be best to extend the Chart and handle the item roll-over
there; with styles.  Someone else can do that though.

-TH

--- In flexcoders@yahoogroups.com, "gmoniey22"  wrote:
>
> I wasn't aware that you could do it through css. I like that solution
better than mine (particularly because it works).
>
> --- In flexcoders@yahoogroups.com, "Tim Hoff" TimHoff@ wrote:
> >
> >
> > Here's a slightly different approach:
> >
> > Chart Labeled Renderer Roll-Over Sample
> >
 > eledRendererSample.html>
> >
> > -TH
> >
> > --- In flexcoders@yahoogroups.com, "gmoniey22"  wrote:
> > >
> > > Is it possible to change the fill color of 1 column when the mouse
is
> > over it? I can't seem to figure it out I have something along these
> > lines:
> > >
> > > 
> > > 
> > >
> > >  > itemRollOver="updateHoverColor(event)"
itemRollOut="updateColor(event)">
> > > 
> > > 
> > > 
> > >
> > > 
> > >  > fill="{barColor}"/>
> > > 
> > > 
> > >
> > >
> > > And my hover function looks like:
> > >
> > > private function updateHoverColor(event:ChartItemEvent):void {
> > > var col:ColumnSeriesItem =
ColumnSeriesItem(event.hitData.chartItem);
> > > col.fill = hoverBarColor;
> > > }
> > >
> > > Unfortunately, nothing happens. No errors are thrown, but the
color of
> > the column which is being hovered over is not changed.
> > >
> > > I also tried adding the mouseOver/rollOver callbacks to the
> > ColumnSeries, and used a function as such:
> > >
> > > private function updateHoverColor(event:ChartItemEvent):void {
> > > event.target.setStyle("fill", hoverBarColor);
> > > }
> > >
> > > but that resulted in the color of all of the columns to change.
> > >
> > > Anyone have any ideas?
> > >
> > > Thanks!
> > >
> >
>





[flexcoders] Re: Possible to change the Fill Color for ColumnSeries on itemRollOver?

2009-07-09 Thread gmoniey22
I wasn't aware that you could do it through css. I like that solution better 
than mine (particularly because it works).

--- In flexcoders@yahoogroups.com, "Tim Hoff"  wrote:
>
> 
> Here's a slightly different approach:
> 
> Chart Labeled Renderer Roll-Over Sample
>  eledRendererSample.html>
> 
> -TH
> 
> --- In flexcoders@yahoogroups.com, "gmoniey22"  wrote:
> >
> > Is it possible to change the fill color of 1 column when the mouse is
> over it? I can't seem to figure it out I have something along these
> lines:
> >
> > 
> > 
> >
> >  itemRollOver="updateHoverColor(event)" itemRollOut="updateColor(event)">
> > 
> > 
> > 
> >
> > 
> >  fill="{barColor}"/>
> > 
> > 
> >
> >
> > And my hover function looks like:
> >
> > private function updateHoverColor(event:ChartItemEvent):void {
> > var col:ColumnSeriesItem = ColumnSeriesItem(event.hitData.chartItem);
> > col.fill = hoverBarColor;
> > }
> >
> > Unfortunately, nothing happens. No errors are thrown, but the color of
> the column which is being hovered over is not changed.
> >
> > I also tried adding the mouseOver/rollOver callbacks to the
> ColumnSeries, and used a function as such:
> >
> > private function updateHoverColor(event:ChartItemEvent):void {
> > event.target.setStyle("fill", hoverBarColor);
> > }
> >
> > but that resulted in the color of all of the columns to change.
> >
> > Anyone have any ideas?
> >
> > Thanks!
> >
>




[flexcoders] Re: Possible to change the Fill Color for ColumnSeries on itemRollOver?

2009-07-09 Thread Tim Hoff

Here's a slightly different approach:

Chart Labeled Renderer Roll-Over Sample


-TH

--- In flexcoders@yahoogroups.com, "gmoniey22"  wrote:
>
> Is it possible to change the fill color of 1 column when the mouse is
over it? I can't seem to figure it out I have something along these
lines:
>
> 
> 
>
> 
> 
> 
> 
>
> 
> 
> 
> 
>
>
> And my hover function looks like:
>
> private function updateHoverColor(event:ChartItemEvent):void {
> var col:ColumnSeriesItem = ColumnSeriesItem(event.hitData.chartItem);
> col.fill = hoverBarColor;
> }
>
> Unfortunately, nothing happens. No errors are thrown, but the color of
the column which is being hovered over is not changed.
>
> I also tried adding the mouseOver/rollOver callbacks to the
ColumnSeries, and used a function as such:
>
> private function updateHoverColor(event:ChartItemEvent):void {
> event.target.setStyle("fill", hoverBarColor);
> }
>
> but that resulted in the color of all of the columns to change.
>
> Anyone have any ideas?
>
> Thanks!
>