findDataPoints() 中的 Flex PlotChart 缩放错误
我发现了这个很棒的教程,介绍如何通过在折线图中绘制矩形来放大图表来放大图表(http://blog.ninjacaptain.com/2010/03/flex-chart-zoom-window/),但我正在尝试将其应用于相反,我在尝试获取显示以下错误的 DataTips 时遇到问题:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.charts.series::PlotSeries/findDataPoints()[E:\dev\4.5.1\frameworks\projects\charts\src\mx\charts\series\PlotSeries.as:961]
at mx.charts.chartClasses::ChartBase/findDataPoints()[E:\dev\4.5.1\frameworks\projects\charts\src\mx\charts\chartClasses\ChartBase.as:2069]
at mx.charts.chartClasses::ChartBase/mouseClickHandler()[E:\dev\4.5.1\frameworks\projects\charts\src\mx\charts\chartClasses\ChartBase.as:4823]
链接提到了有关扩展 LineChartSeries 并覆盖 findDataPoints() 函数,但在尝试对扩展 PlotSeries.as 执行相同操作后,sortOnXField 似乎未定义,我无权访问 PlotSeries.as,因为它位于 swc 中。
有没有人尝试将以下内容应用于 PlotChart 并显示数据提示? findDataPoints() 中的覆盖函数是什么?
谢谢
I came across this great tutorial on how to zoom into a chart by drawing a rectangle in a LineChart to zoom into it (http://blog.ninjacaptain.com/2010/03/flex-chart-zoom-window/) but i'm trying to apply it to a PlotChart instead and i'm having issues trying to get the DataTips showing with the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.charts.series::PlotSeries/findDataPoints()[E:\dev\4.5.1\frameworks\projects\charts\src\mx\charts\series\PlotSeries.as:961]
at mx.charts.chartClasses::ChartBase/findDataPoints()[E:\dev\4.5.1\frameworks\projects\charts\src\mx\charts\chartClasses\ChartBase.as:2069]
at mx.charts.chartClasses::ChartBase/mouseClickHandler()[E:\dev\4.5.1\frameworks\projects\charts\src\mx\charts\chartClasses\ChartBase.as:4823]
The link mentioned about extending the LineChartSeries and override the findDataPoints() function, but after trying to doing the same for extending PlotSeries.as, sortOnXField seems to be undefined and I don't have access to the PlotSeries.as since it is in a swc.
Has anyone tried applying the following to a PlotChart instead and got the DataTips to show? What was the override function in the findDataPoints()?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
几天前我在 PieSeries 上遇到了同样的问题。
我还没有找到为什么“filterDataPoints”函数中“_renderData.filteredCache”为空,但同时我已经解决了以这种方式扩展 PieSeries 类的问题:
我希望它可以帮助您
Some days ago I had the same problem with PieSeries.
I have not found yet why '_renderData.filteredCache' is null in 'filterDataPoints' function, but meanwhile I have resolved the problem extending PieSeries Class this way:
I hope it could help you
如果您询问如何解决访问图表点时的“filterDataPoints”问题,您只需创建自己的 Series 类,将 PlotSeries 中的代码复制粘贴到其中,并更改运行时失败的任何内容。你会得到什么样的错误?
If you're asking about how to solve the "filterDataPoints" issue in accessing chart points, you just have to create you own Series class, copy-paste the code from PlotSeries in it and change whatever fails on runtime. What kind of error do you get ?