[flexcoders] Re: Possible to change the Fill Color for ColumnSeries on itemRollOver?
Here's a slightly different approach: Chart Labeled Renderer Roll-Over Sample http://www.timothyhoff.com/projects/ChartLabeledRendererSample/ChartLab\ eledRendererSample.html -TH --- In flexcoders@yahoogroups.com, gmoniey22 gmonie...@... 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: mx:SolidColor id=barColor color=0x00FF00/ mx:SolidColor id=hoverBarColor color=0xFF/ mx:ColumnChart id=chart type=overlaid itemRollOver=updateHoverColor(event) itemRollOut=updateColor(event) mx:horizontalAxis mx:CategoryAxis categoryField=range/ /mx:horizontalAxis mx:series mx:ColumnSeries id=series xField=range yField=value fill={barColor}/ /mx:series /mx:ColumnChart 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?
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 timh...@... wrote: Here's a slightly different approach: Chart Labeled Renderer Roll-Over Sample http://www.timothyhoff.com/projects/ChartLabeledRendererSample/ChartLab\ eledRendererSample.html -TH --- In flexcoders@yahoogroups.com, gmoniey22 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: mx:SolidColor id=barColor color=0x00FF00/ mx:SolidColor id=hoverBarColor color=0xFF/ mx:ColumnChart id=chart type=overlaid itemRollOver=updateHoverColor(event) itemRollOut=updateColor(event) mx:horizontalAxis mx:CategoryAxis categoryField=range/ /mx:horizontalAxis mx:series mx:ColumnSeries id=series xField=range yField=value fill={barColor}/ /mx:series /mx:ColumnChart 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?
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 gmonie...@... 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 http://www.timothyhoff.com/projects/ChartLabeledRendererSample/ChartLab\ \ eledRendererSample.html -TH --- In flexcoders@yahoogroups.com, gmoniey22 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: mx:SolidColor id=barColor color=0x00FF00/ mx:SolidColor id=hoverBarColor color=0xFF/ mx:ColumnChart id=chart type=overlaid itemRollOver=updateHoverColor(event) itemRollOut=updateColor(event) mx:horizontalAxis mx:CategoryAxis categoryField=range/ /mx:horizontalAxis mx:series mx:ColumnSeries id=series xField=range yField=value fill={barColor}/ /mx:series /mx:ColumnChart 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!