2016-02-07 101 views
2

我想将点的形状设置为圆形。这就是我要做的事:更改XYPlot系列的点的形状

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

然后我得到以下结果:

enter image description here

圈有轻微的偏移。我试图改变(-5,-5,5,5)以便按照行中心圈,但没有任何工作。围绕这些圈子的正确方法是什么?

回答

3

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

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

一个相关的例子是检查here,如response注意到这个comment

+0

另请参阅此[相关示例](http://stackoverflow.com/a/13035777/230513)。 – trashgod