My guess would be that you've got a performance gate at the top of your
set data(...) function. If the item renderer is being a passed a
reference to an item it already knows about, your set data(...) function
bails out. Which means that the code immediate below...which loads all
of the data out of the item into cached fields...never gets run. So if
the dataprovider hasn't changed, but the individual items have,
generally your item renderer won't update its cached values.
Remove that line, and it might solve your problems?
Ely.
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of simonjpalmer
Sent: Tuesday, May 15, 2007 1:49 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Absolutely forcing chart to redraw
grasping at straws, have you tried a bubble chart instead? I suspect
the series are derived from the same root.
or maybe you could subclass the plotseries and overload
updateTransform or some other suitable method.
just ideas
I managed to get my similar problem basically working by writing a
fair bit of code that made sure the bound data actually changed. In
my case (which I think was different) I was not quite binding
correctly so the data I was changing was not causing the update. I
haven't cracked it completely and I'm certain that I get situations
where item renderers are re-used as new data points occasionally
have the same colour properties as data points which have been removed
from the chart and are inappropriate for their data. All a bit
mysterious I'm afraid.
Is the charting code going open source?
--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, carl_steinhilber
[EMAIL PROTECTED] wrote:
Anybody have ANY insight?
Bueller? Bueller?
--- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com , carl_steinhilber
carl_steinhilber@ wrote:
--- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com , Ely Greenfield egreenfi@
wrote:
Hi Carl. I'd like to help, but I really need to see your code.
Again, a very simple example...
Thanks Ely. I've trimmed it down as much as I think I can... I have
a
lot more going on, but this is it in it's basic form... and it still
exhibits the same issues.
MXML
==
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
creationComplete=appInit() layout=absolute
mx:Script
![CDATA[
[Bindable]
public var localData:Array;
private function appInit(){
localData = [
{name:Plot
A,xAxis:5,yAxis:6,size:24,visible:1},
{name:Plot
B,xAxis:-5,yAxis:6,size:50,visible:1},
{name:Plot
C,xAxis:5,yAxis:-6,size:50,visible:1}
];
}
private function redrawChart(){
plotClient.dataProvider = gridClient.dataProvider;
}
]]
/mx:Script
mx:HBox
mx:Panel width=100% height=100%
mx:PlotChart id=plotClient height=100% width=100%
dataProvider={localData} axisTitleStyleName=linearAxis
paddingBottom=20 paddingLeft=20 paddingRight=20
paddingTop=20
showDataTips=true
mx:horizontalAxis
mx:LinearAxis baseAtZero=false maximum=11 minimum=-11
title=lt; X Axis gt; /
/mx:horizontalAxis
mx:verticalAxis
mx:LinearAxis baseAtZero=false maximum=11 minimum=-11
title=lt; Y Axis gt; /
/mx:verticalAxis
mx:series
mx:PlotSeries displayName=Chart id=chartPlotSeries
itemRenderer=ClientItemRenderer xField=xAxis yField=yAxis /
/mx:series
/mx:PlotChart
/mx:Panel
mx:Panel width=100% height=100%
mx:DataGrid dataProvider={localData} click=redrawChart()
editable=true height=100% id=gridClient name=gridClient
width=100%
mx:columns
mx:DataGridColumn dataField=name headerText=Name
textAlign=left /
mx:DataGridColumn dataField=xAxis headerText=X Axis /
mx:DataGridColumn dataField=yAxis headerText=Y Axis /
mx:DataGridColumn dataField=size headerText=Size /
mx:DataGridColumn dataField=visible headerText=Show /
/mx:columns
/mx:DataGrid
/mx:Panel
/mx:HBox
/mx:Application
And my ClientItemRenderer AS is pretty much just a revision of the
samples on QuietlyScheming
ClientItemRenderer.as
==
package
{
import mx.skins.ProgrammaticSkin;
import flash.geom.Rectangle;
import mx.graphics.*;
import flash.display.Graphics;
import mx.core.IDataRenderer;
import mx.charts.ChartItem;
import flash.events.MouseEvent;
import mx.core.UIComponent;
import mx.controls.Label;
import mx.charts.PlotChart;
import mx.charts.series.items.PlotSeriesItem;
import flash.events.Event;
import mx.events.FlexEvent;
public class ClientItemRenderer extends UIComponent implements
IDataRenderer
{
private var _label:Label;
private var _status:Label;
private var _itemFill:uint;
private var _itemVisible:Boolean;
private var _itemSize:int;
private var _itemXAxis:int;
private var _itemYAxis:int;
public function