2

I want to set a shape of points as a circle. This is how I do it:

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

Then I get the following result:

enter image description here

Circles are slightly shifted. I tried to change (-5,-5,5,5) in order to center circles according to the line, but nothing has worked. What is the right way to center the circles?

Klausos Klausos
  • 15,308
  • 51
  • 135
  • 217

1 Answers1

3

Note that the Ellipse2D boundary includes the upper-left corner's x and y coordinates, as well as width and height. You probably want something like this:

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

A related examples is examined here, as noted in the response to this comment.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045