Android: looking for a drawArc() method with inner & outer radius

You can do this: Paint paint = new Paint(); final RectF rect = new RectF(); //Example values rect.set(mWidth/2- mRadius, mHeight/2 – mRadius, mWidth/2 + mRadius, mHeight/2 + mRadius); paint.setColor(Color.GREEN); paint.setStrokeWidth(20); paint.setAntiAlias(true); paint.setStrokeCap(Paint.Cap.ROUND); paint.setStyle(Paint.Style.STROKE); canvas.drawArc(rect, -90, 360, false, paint); The key is in paint.setStyle(Paint.Style.STROKE);, it crops the arc’s center with the stroke that you define in … Read more

JFreechart draw arc on chart

The critical thing about Arc2D is the bounding rectangle. To make the half-arc H units high, the bounds must be 2 * H units high. AFAIK, PolarPlot does not support annotations. import java.awt.BasicStroke; import java.awt.Color; import java.awt.geom.Arc2D; import java.util.Random; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartFrame; import org.jfree.chart.JFreeChart; import org.jfree.chart.annotations.XYLineAnnotation; import org.jfree.chart.annotations.XYShapeAnnotation; import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; import org.jfree.data.xy.XYDataset; … Read more