改变 XYPlot 系列点的形状

Change a shape of points of XYPlot series

我想将点的形状设置为圆形。我是这样做的:

Shape shape  = new Ellipse2D.Double(-5,-5,5,5);
renderer.setSeriesShape(0,  shape);

然后我得到以下结果:

圆圈略有偏移。我试图更改 (-5,-5,5,5) 以便根据该行将圆居中,但没有任何效果。使圆圈居中的正确方法是什么?

请注意,Ellipse2D 边界包括左上角的 xy 坐标,以及 widthheight。你可能想要这样的东西:

Shape shape  = new Ellipse2D.Double(-5, -5, 10, 10);

相关实例查看here, as noted in the response to this comment.