0
votes

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

2
Can you post some code, to understand your logic?papachan

2 Answers

2
votes

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:

package com.eque.report.model {

import mx.charts.series.PieSeries;

public class MyPieSeries extends PieSeries {

    public function MyPieSeries () {
        super();
    }

    /**
     * 'findDataPoints' function has been overriden in order to prevent
     * '_renderData.filteredCache' is null.
     */
    override public function findDataPoints(x:Number, y:Number, sensitivity:Number):Array {
        if (renderData.filteredCache == null) {
            renderData.filteredCache = [];
        }
        return super.findDataPoints(x, y, sensitivity);
    }

}
}

I hope it could help you

0
votes

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 ?