Code example for DashPathEffect

Methods: setPathEffect

0
        canvas.drawLines(getFloatArray(), getPaint());
        drawGraph(canvas);
    } 
 
    private void drawGraph(Canvas canvas) {
        getGraphPaint().setPathEffect(new DashPathEffect(new float[] {10,10}, dashPhaser+=getInterval()));
        canvas.drawLine(getAxis() + 1*getAmplify(), getParentViewHeight(), getAxis() + 1*getAmplify(), 0, getGraphPaint());
        canvas.drawLine(getAxis() - 1*getAmplify(), getParentViewHeight(), getAxis() - 1*getAmplify(), 0, getGraphPaint());
    } 
 
    public void drawPen(Canvas canvas) {
        canvas.drawLine(getPenLeftStartX(), 0, getPenEndX(), getBrushLength(), getPenPaint());
        canvas.drawLine(getPenRightStartX(), 0, getPenEndX(), getBrushLength(), getPenPaint());
    } 
 
    private float getPenLeftStartX() { 
        return (getAxis() - getBrushWidth() + getAxis() + getPts().peek() * getAmplify()) / 2; 
    } 
 
    private float getPenRightStartX() {