Maximum number of points in a series

24 views
Skip to first unread message

The B Team

unread,
Jun 7, 2019, 4:41:28 PM6/7/19
to Androidplot
Does anyone know what the maximum number of points a series can have. I have around 17,500 points that I want to plot on my XYPlot, but the Android app freezes when the series is added to the plot. 


I have tried this:


private void graph() {
    XYSeries series1 = new SimpleXYSeries(Arrays.asList(seriesOfNumbers), SimpleXYSeries.ArrayFormat.Y_VALS_ONLY,mFilename);

    mFormat = new LineAndPointFormatter(Color.RED, Color.TRANSPARENT, Color.WHITE, null);

    mFormat.setInterpolationParams(new CatmullRomInterpolator.Params(20, CatmullRomInterpolator.Type.Centripetal));

    gPlot.addSeries(series1, mFormat);
}

this:


protected XYSeries generateSeries(ArrayList<String> bRows) {

    List<Number> xVals = new ArrayList<>();
    List<Number> yVals = new ArrayList<>();

    int i = 1;

    for (String b : bRows) {

        xVals.add(i);
        yVals.add(Float.valueOf(b));
        i++;
    }

    return new SimpleXYSeries(xVals, yVals,""+i);
}

gPlot.addSeries(generateSeries(series1), mFormat);

and this:


public void calculateGraph() {
    seriesOfNumbers = new Number[mNewDataListCount];

    for (int i = 0; i < mNewDataListCount; i++) {
        seriesOfNumbers[i] = Double.parseDouble(mNewDataList.get(i));
    }

    mFormat = new LineAndPointFormatter(Color.RED, Color.TRANSPARENT, Color.WHITE, null);

    mFormat.setInterpolationParams(new CatmullRomInterpolator.Params(20, CatmullRomInterpolator.Type.Centripetal));

    XYSeries series1 = new SimpleXYSeries(Arrays.asList(seriesOfNumbers), SimpleXYSeries.ArrayFormat.Y_VALS_ONLY,mFilename);

    gPlot.addSeries(series1, mFormat);
}

I am assuming that the number of plot-able points is slowing down the plot production. Can anyone show me how I can process 17,500 rows into XYPlot points on the androidPlot graph.

Reply all
Reply to author
Forward
0 new messages