2

I would like to customize my PolarChart to replace the angle values displayed in a PolarChart by default enter image description here , with custom strings like this : enter image description here

Kowlown
  • 920
  • 10
  • 26

1 Answers1

2

You can override the refreshAngleTicks() method of PolarPlot, as shown here:

import static org.jfree.ui.TextAnchor.*
…
PolarPlot plot = new PolarPlot() {

    @Override
    protected List refreshAngleTicks() {
        List ticks = new ArrayList();
        ticks.add(new NumberTick(0, "maxCharTick: 20", TOP_LEFT, TOP_LEFT, 0));
        ticks.add(new NumberTick(45, "energyComsuption: 1", TOP_LEFT, TOP_LEFT, 0));
        ticks.add(new NumberTick(90, "maxDamage: 40", TOP_LEFT, TOP_LEFT, 0));
        …
        return ticks;
    }
};

Alternatively, consider a SpiderWebPlot, shown here.

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