3

I want a dotted line, as described in the official documentation:

    futureSeries.setDrawDataPoints(true);

    Paint paint = new Paint();
    paint.setStyle(Paint.Style.STROKE);
    paint.setStrokeWidth(10);
    paint.setPathEffect(new DashPathEffect(new float[]{8, 5}, 0));
    futureSeries.setCustomPaint(paint);

    graph.addSeries(futureSeries);

build.gradle:

   compile 'com.jjoe64:graphview:4.2.1'

The result is not a dotted line:

enter image description here

Something like this would be okay:

enter image description here

azizbekian
  • 60,783
  • 13
  • 169
  • 249
Jim Clermonts
  • 1,694
  • 8
  • 39
  • 94

1 Answers1

7

Just apply LineGraphSeries#setDrawAsPath(true).

Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(10);
paint.setPathEffect(new DashPathEffect(new float[]{8, 5}, 0));

LineGraphSeries<DataPoint> series = ... // init

series.setDrawAsPath(true);
series.setCustomPaint(paint);

graphView.addSeries(series);

Result:

enter image description here

azizbekian
  • 60,783
  • 13
  • 169
  • 249