[flexcoders] Re: Apparent Bug in LineCharts - filterData property Kills Data Tips
Hehe, sorry, I didn't mean to come across as a meanie. An annoyance at work put me in a bad mood. I'm glad that's helped. Graham --- In flexcoders@yahoogroups.com, "thegiffman" <[EMAIL PROTECTED]> wrote: > > It wasn't for lack of looking or trying. I saw that _renderData has a > public getter, but I was still stuck on: > > hd.dataTipFunction = formatDataTip; > > formatDataTip is a private function. > > But then, of course, the contents of formatDataTip don't access > anything private... Doh! > > Thanks, Graham. > > - Giff >
[flexcoders] Re: Apparent Bug in LineCharts - filterData property Kills Data Tips
It wasn't for lack of looking or trying. I saw that _renderData has a public getter, but I was still stuck on: hd.dataTipFunction = formatDataTip; formatDataTip is a private function. But then, of course, the contents of formatDataTip don't access anything private... Doh! Thanks, Graham. - Giff
[flexcoders] Re: Apparent Bug in LineCharts - filterData property Kills Data Tips
Extend the LineSeries class. Override the findDataPoitns function. In its body, paste a copy of that from the original LineSeries class. Change the if (!isNaN(v.yFilter) && !isNaN(v.xFilter)) to if (!isNaN(v.yNumber) && !isNaN(v.xNumber)). Replace all _renderData references with just renderData. I thought that last bit was obvious because I assumed you'd actually looked at the source code properly. Graham --- In flexcoders@yahoogroups.com, "thegiffman" <[EMAIL PROTECTED]> wrote: > > Have you figured out a way to do this by extending the LineSeries > class, rather than replacing it? I can copy the code in LineSeries to > my own file, and have the compiler use that, rather than the internal > one. Then I can do the fix. However, I cannot actually do it by > extending LineSeries, because findDataPoints references private > variables and functions (like nearly all the mx functions we'd like to > extend :-( ). > > --- In flexcoders@yahoogroups.com, "g_odds" wrote: > > > > I noticed this bug several weeks ago and fortunately I managed to find > > the problem and create a workaround. > > > > You'll have to have a poke around in the LineSeries source code to > > fully understand what I'm saying here. You need to extend the > > LineSeries class and extend the findDataPoints function. In the > > LineSeries' findDataPoints function the if (!isNaN(v.yFilter) && > > !isNaN(v.xFilter)) condition will fail because when filterData = false > > and the filterCache function of the series is called (this happens > > when the min or max of an axis is set because the mapping changes) the > > .yFilter and xFilter properties will be set to NaN for the points. > > That makes sense in it's own way, but the upshot of that is that the > > minItem variable is never set and, therefore, an empty array will > > always be returned. > > > > So the fix is to copy the code from the LineSeries source code and in > > your overriding function change the if (!isNaN(v.yFilter) && > > !isNaN(v.xFilter)) condition to if (!isNaN(v.yNumber) && > > !isNaN(v.xNumber)). So yes, this is a nasty little hack but I haven't > > found any other way to solve the problem. > > > > Hope that helps, > > > > Graham > > > > > > --- In flexcoders@yahoogroups.com, "thegiffman" wrote: > > > > > > If I take the standard line chart demo code, and add showDataTips to > > > the line chart, they display normally. Yet, the moment I set > > > filterData to false on one of the LineSeries, it kills data tips for > > > this series. I think this is a bug in the charting components, as the > > > data tips and the filterData attribute do not conflict for column > > > charts. > > > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml";> > > > > > > > > showDataTips="true"> > > > > > > > > > > > > > > > > > categoryField="Month"/> > > > > > > > > > > > filterData="false"/> > > > > > > > > > > > > > > > > > > > > >
[flexcoders] Re: Apparent Bug in LineCharts - filterData property Kills Data Tips
Have you figured out a way to do this by extending the LineSeries class, rather than replacing it? I can copy the code in LineSeries to my own file, and have the compiler use that, rather than the internal one. Then I can do the fix. However, I cannot actually do it by extending LineSeries, because findDataPoints references private variables and functions (like nearly all the mx functions we'd like to extend :-( ). --- In flexcoders@yahoogroups.com, "g_odds" <[EMAIL PROTECTED]> wrote: > > I noticed this bug several weeks ago and fortunately I managed to find > the problem and create a workaround. > > You'll have to have a poke around in the LineSeries source code to > fully understand what I'm saying here. You need to extend the > LineSeries class and extend the findDataPoints function. In the > LineSeries' findDataPoints function the if (!isNaN(v.yFilter) && > !isNaN(v.xFilter)) condition will fail because when filterData = false > and the filterCache function of the series is called (this happens > when the min or max of an axis is set because the mapping changes) the > .yFilter and xFilter properties will be set to NaN for the points. > That makes sense in it's own way, but the upshot of that is that the > minItem variable is never set and, therefore, an empty array will > always be returned. > > So the fix is to copy the code from the LineSeries source code and in > your overriding function change the if (!isNaN(v.yFilter) && > !isNaN(v.xFilter)) condition to if (!isNaN(v.yNumber) && > !isNaN(v.xNumber)). So yes, this is a nasty little hack but I haven't > found any other way to solve the problem. > > Hope that helps, > > Graham > > > --- In flexcoders@yahoogroups.com, "thegiffman" wrote: > > > > If I take the standard line chart demo code, and add showDataTips to > > the line chart, they display normally. Yet, the moment I set > > filterData to false on one of the LineSeries, it kills data tips for > > this series. I think this is a bug in the charting components, as the > > data tips and the filterData attribute do not conflict for column > > charts. > > > > > > > > > > > > http://www.adobe.com/2006/mxml";> > > > > > showDataTips="true"> > > > > > > > > > > > categoryField="Month"/> > > > > > > > filterData="false"/> > > > > > > > > > > > > >
[flexcoders] Re: Apparent Bug in LineCharts - filterData property Kills Data Tips
I noticed this bug several weeks ago and fortunately I managed to find the problem and create a workaround. You'll have to have a poke around in the LineSeries source code to fully understand what I'm saying here. You need to extend the LineSeries class and extend the findDataPoints function. In the LineSeries' findDataPoints function the if (!isNaN(v.yFilter) && !isNaN(v.xFilter)) condition will fail because when filterData = false and the filterCache function of the series is called (this happens when the min or max of an axis is set because the mapping changes) the .yFilter and xFilter properties will be set to NaN for the points. That makes sense in it's own way, but the upshot of that is that the minItem variable is never set and, therefore, an empty array will always be returned. So the fix is to copy the code from the LineSeries source code and in your overriding function change the if (!isNaN(v.yFilter) && !isNaN(v.xFilter)) condition to if (!isNaN(v.yNumber) && !isNaN(v.xNumber)). So yes, this is a nasty little hack but I haven't found any other way to solve the problem. Hope that helps, Graham --- In flexcoders@yahoogroups.com, "thegiffman" <[EMAIL PROTECTED]> wrote: > > If I take the standard line chart demo code, and add showDataTips to > the line chart, they display normally. Yet, the moment I set > filterData to false on one of the LineSeries, it kills data tips for > this series. I think this is a bug in the charting components, as the > data tips and the filterData attribute do not conflict for column > charts. > > > > > > http://www.adobe.com/2006/mxml";> > > showDataTips="true"> > > > > > categoryField="Month"/> > > > filterData="false"/> > > > > > >