3

Library: graphview Version: 4.2.1

Is it possible to set background color between two curves? Like this:

enter image description here

setDrawBackground changes color between curve and coordinate line, it isn't what I need:

enter image description here

Code for exaple:

        LineGraphSeries<DataPoint> seriesUp = new LineGraphSeries<>(new DataPoint[]{
            new DataPoint(0, 3),
            new DataPoint(1, 7),
            new DataPoint(2, 5),
            new DataPoint(3, 4),
            new DataPoint(4, 8)
    });
    graph.addSeries(seriesUp);
    seriesUp.setDrawBackground(false);
    seriesUp.setColor(Color.MAGENTA);
    seriesUp.setDrawBackground(true);


    LineGraphSeries<DataPoint> series = new LineGraphSeries<>(new DataPoint[]{
            new DataPoint(0, 2),
            new DataPoint(1, 6),
            new DataPoint(2, 4),
            new DataPoint(3, 3),
            new DataPoint(4, 7)
    });
    graph.addSeries(series);
    graph.getViewport().setScalableY(true);
    series.setThickness(5);
    series.setColor(Color.RED);
    series.setAnimated(true);
    series.setDrawDataPoints(true);
    series.setDataPointsRadius(10);
    series.setBackgroundColor(Color.CYAN);
    series.setDrawBackground(false);
tse
  • 5,769
  • 6
  • 38
  • 58
  • I need same, what you ask. did you got any solution for draw background only between two series? – Palanivelraghul Oct 05 '17 at 12:02
  • https://github.com/PhilJay/MPAndroidChart in this library filled line chart option is there in that they achieve that adding background only between two line graph. – Palanivelraghul Oct 09 '17 at 05:50

0 Answers0