Skip to content
Advertisement

how to change dot shape with jfree polar plot?

I would like to know what are the methods to use to change dots polarplot size and shape . And also if it’s possible to disable dots for this type of plot .

here is the code plotting polar of two series with default dots.

Thank you

JavaScript

Advertisement

Answer

with it, default dots are square.

Yes, the DefaultPolarItemRenderer uses a 6 x 6 square DEFAULT_SHAPE:

JavaScript

how to [make] them round and smaller?

As suggested here, use a custom DrawingSupplier. In the example below, the default Shape for all series is set to a circle of radius 2.5. ShapeUtils, shown in a comment, may also be useful:

JavaScript

how to disabled them?

Invoke setShapesVisible() as warranted:

JavaScript

In addition,

  • You can zoom the chart radially as shown here.

  • Instead of making a new PolarPlot(), get the one instantiated by the chart’s factory.

  • To establish the chart’s initial size, override getPreferredSize(), as suggested here.

  • Use (nearly) equal width and height to maximize the plot in the enclosing container.

  • Construct and manipulate Swing GUI objects only on the event dispatch thread.

image

As tested:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement