M.Kassim
M.Kassim

Reputation: 33

Drawing a rotated ellipse using Ellipse.2D shape Annotation

Can any one help me to know how to draw a rotated ellipse using Ellipse.2D shape annotation with a given angle in JFreeChart?

Upvotes: 1

Views: 539

Answers (1)

trashgod
trashgod

Reputation: 205785

Given an XYPlot in , you can

  • Add an XYShapeAnnotation to the plot, as shown here and here.

  • Invoke setBaseShape() on the plot's renderer, as shown here, to change the shape for a whole series.

  • Override getItemShape() in the plot's renderer, as shown here, to change an individual shape.

In any case, you can rotate the Shape using the createTransformedShape() method of AffineTransform, as shown here.

Upvotes: 1

Related Questions