Example usage for org.jfree.chart.plot PolarPlot setAngleTickUnit

List of usage examples for org.jfree.chart.plot PolarPlot setAngleTickUnit

Introduction

In this page you can find the example usage for org.jfree.chart.plot PolarPlot setAngleTickUnit.

Prototype

public void setAngleTickUnit(TickUnit unit) 

Source Link

Document

Sets the tick unit that controls the spacing of the angular grid lines, and sends a PlotChangeEvent to all registered listeners.

Usage

From source file:org.hxzon.demo.jfreechart.PolarChartDemo.java

private static JFreeChart createPolarChart(XYDataset dataset) {
    boolean legend = true;
    PolarPlot plot = new PolarPlot();
    plot.setDataset(dataset);//w  w  w  . ja  va 2 s .  c o m
    NumberAxis rangeAxis = new NumberAxis();
    rangeAxis.setAxisLineVisible(false);
    rangeAxis.setTickMarksVisible(false);
    rangeAxis.setTickLabelInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
    plot.setAxis(rangeAxis);
    plot.setRenderer(new DefaultPolarItemRenderer());
    JFreeChart chart = new JFreeChart("Polar Chart Demo", JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    chart.setBackgroundPaint(Color.white);

    plot.setBackgroundPaint(Color.lightGray);

    plot.setAngleGridlinesVisible(true);
    plot.setAngleLabelsVisible(true);
    plot.setAngleTickUnit(new NumberTickUnit(5));

    return chart;
}

From source file:org.hxzon.demo.jfreechart.OtherDatasetDemo.java

private static JFreeChart createPolarChart(XYDataset dataset) {

    PolarPlot plot = new PolarPlot();
    plot.setDataset(dataset);//www  . j av  a  2 s . c  o  m
    NumberAxis rangeAxis = new NumberAxis();
    rangeAxis.setAxisLineVisible(false);
    rangeAxis.setTickMarksVisible(false);
    rangeAxis.setTickLabelInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
    plot.setAxis(rangeAxis);
    plot.setRenderer(new DefaultPolarItemRenderer());
    JFreeChart chart = new JFreeChart("Polar Chart Demo", JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
    chart.setBackgroundPaint(Color.white);

    plot.setBackgroundPaint(Color.lightGray);

    plot.setAngleGridlinesVisible(true);
    plot.setAngleLabelsVisible(true);
    plot.setAngleTickUnit(new NumberTickUnit(5));

    return chart;
}