use of org.jfree.chart.plot.PolarPlot in project seng438-a3-R41Ryan by seng438-winter-2022.
the class ChartFactory method createPolarChart.
/**
* Creates a polar plot for the specified dataset (x-values interpreted as
* angles in degrees). The chart object returned by this method uses a
* {@link PolarPlot} instance as the plot, with a {@link NumberAxis} for
* the radial axis.
*
* @param title the chart title (<code>null</code> permitted).
* @param dataset the dataset (<code>null</code> permitted).
* @param legend legend required?
* @param tooltips tooltips required?
* @param urls URLs required?
*
* @return A chart.
*/
public static JFreeChart createPolarChart(String title, XYDataset dataset, boolean legend, boolean tooltips, boolean urls) {
PolarPlot plot = new PolarPlot();
plot.setDataset(dataset);
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(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
currentTheme.apply(chart);
return chart;
}
use of org.jfree.chart.plot.PolarPlot in project ES-LEI-2Sem-2022-Grupo-1 by tmrbo-iscte.
the class DefaultPolarPlotEditor method updatePlotProperties.
@Override
public void updatePlotProperties(Plot plot) {
super.updatePlotProperties(plot);
PolarPlot pp = (PolarPlot) plot;
pp.setAngleTickUnit(new NumberTickUnit(this.manualTickUnitValue));
pp.setAngleOffset(this.angleOffsetValue);
}
use of org.jfree.chart.plot.PolarPlot in project ES-LEI-2Sem-2022-Grupo-1 by tmrbo-iscte.
the class DefaultPlotEditor method createPlotTabs.
/**
* Creates a tabbed pane for the plot.
*
* @param plot the plot.
*
* @return A tabbed pane.
*/
protected JTabbedPane createPlotTabs(Plot plot) {
JTabbedPane tabs = new JTabbedPane();
tabs.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
Axis domainAxis = null;
if (plot instanceof CategoryPlot) {
domainAxis = ((CategoryPlot) plot).getDomainAxis();
} else if (plot instanceof XYPlot) {
domainAxis = ((XYPlot) plot).getDomainAxis();
}
this.domainAxisPropertyPanel = DefaultAxisEditor.getInstance(domainAxis);
if (this.domainAxisPropertyPanel != null) {
this.domainAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
tabs.add(localizationResources.getString("Domain_Axis"), this.domainAxisPropertyPanel);
}
Axis rangeAxis = null;
if (plot instanceof CategoryPlot) {
rangeAxis = ((CategoryPlot) plot).getRangeAxis();
} else if (plot instanceof XYPlot) {
rangeAxis = ((XYPlot) plot).getRangeAxis();
} else if (plot instanceof PolarPlot) {
rangeAxis = ((PolarPlot) plot).getAxis();
}
this.rangeAxisPropertyPanel = DefaultAxisEditor.getInstance(rangeAxis);
if (this.rangeAxisPropertyPanel != null) {
this.rangeAxisPropertyPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
tabs.add(localizationResources.getString("Range_Axis"), this.rangeAxisPropertyPanel);
}
return tabs;
}
use of org.jfree.chart.plot.PolarPlot in project graphcode2vec by graphcode2vec.
the class DefaultPolarItemRenderer method getDrawingSupplier.
/**
* Returns the drawing supplier from the plot.
*
* @return The drawing supplier.
*/
public DrawingSupplier getDrawingSupplier() {
DrawingSupplier result = null;
PolarPlot p = getPlot();
if (p != null) {
result = p.getDrawingSupplier();
}
return result;
}
use of org.jfree.chart.plot.PolarPlot in project graphcode2vec by graphcode2vec.
the class DefaultPolarItemRenderer method getLegendItem.
/**
* Return the legend for the given series.
*
* @param series the series index.
*
* @return The legend item.
*/
public LegendItem getLegendItem(int series) {
LegendItem result = null;
PolarPlot polarPlot = getPlot();
if (polarPlot != null) {
XYDataset dataset = polarPlot.getDataset();
if (dataset != null) {
String label = dataset.getSeriesKey(series).toString();
String description = label;
Shape shape = lookupSeriesShape(series);
Paint paint = lookupSeriesPaint(series);
Paint outlinePaint = lookupSeriesOutlinePaint(series);
Stroke outlineStroke = lookupSeriesOutlineStroke(series);
result = new LegendItem(label, description, null, null, shape, paint, outlineStroke, outlinePaint);
result.setDataset(dataset);
}
}
return result;
}
Aggregations