How to make line with rounded (smooth) corners with AndroidPlot

后端 未结 5 2119
挽巷
挽巷 2020-12-05 08:27

I have a small problem with ploting my graph. On a picture below is what I have already done.


The graph should represent the actual signal strength of availabl

5条回答
  •  我在风中等你
    2020-12-05 09:13

    There's always been a smooth line renderer in Androidplot: BezierLineAndPointRenderer, which like the implementations above uses Android's built in Bezier drawing routines cubicTo(...) & quadTo(...). The problem is that using Beziers to draw smooth lines in this way creates a false line that overshoots the actual control points by varying amounts, which you can see happening if you look closely at the image above.

    The solution is to use the Catmull-Rom spline interpolation, which is now finally supported by Androidplot. Details here: http://androidplot.com/smooth-curves-and-androidplot/

提交回复
热议问题