本文整理汇总了Java中org.jfree.chart.plot.PolarPlot类的典型用法代码示例。如果您正苦于以下问题:Java PolarPlot类的具体用法?Java PolarPlot怎么用?Java PolarPlot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PolarPlot类属于org.jfree.chart.plot包,在下文中一共展示了PolarPlot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPolarChart
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* 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);
return chart;
}
示例2: createPolarChart
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* Creates a polar plot for the specified dataset (x-values interpreted as angles in degrees).
* <P>
* 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 Insets(0, 0, 0, 0));
plot.setRadialAxis(rangeAxis);
plot.setRenderer(new DefaultPolarItemRenderer());
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
return chart;
}
示例3: createPolarChart
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* 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;
}
示例4: createPolarChart
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* 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} permitted).
* @param dataset the dataset ({@code null} 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;
}
示例5: createXYPolarChart
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
private JFreeChart createXYPolarChart(String title, XYDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createPolarChart(
title, dataset, true, false, false);
chart.setBackgroundPaint(Color.white);
// get a reference to the plot for further customisation...
PolarPlot plot = (PolarPlot) chart.getPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setRenderer(new SOCRPolarItemRenderer());
//PolarItemRenderer renderer = plot.getRenderer();
//renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
// set the range axis to display integers only...
NumberAxis rangeAxis = (NumberAxis) plot.getAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
return chart;
}
示例6: getLegendItem
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
public LegendItem getLegendItem(int series) {
LegendItem result = null;
PolarPlot polarPlot = getPlot();
if (polarPlot != null) {
XYDataset dataset;
dataset = polarPlot.getDataset();
s = new Summary(dataset);
if (dataset != null) {
//String label = dataset.getSeriesKey(series).toString();
String label = s.getYSummary(series)+"\n";
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;
}
示例7: createPolarChart
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* 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;
}
示例8: getLegendItem
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* 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;
}
示例9: getLegendItem
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* 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;
dataset = polarPlot.getDataset();
if (dataset != null) {
String label = dataset.getSeriesKey(series).toString();
String description = label;
Shape shape = getSeriesShape(series);
Paint paint = getSeriesPaint(series);
Paint outlinePaint = getSeriesOutlinePaint(series);
Stroke outlineStroke = getSeriesOutlineStroke(series);
result = new LegendItem(label, description, null, null,
shape, paint, outlineStroke, outlinePaint);
}
}
return result;
}
示例10: createPolarChart
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* 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?
*
* @return A chart.
*/
public static JFreeChart createPolarChart(String title, XYDataset dataset,
boolean legend) {
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;
}
示例11: createPolarChart
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
private JFreeChart createPolarChart(final XYDataset dataset,String chartName) {
if(chartName == null)
chartName=FunctionToPlot;
final JFreeChart chRt = ChartFactory.createPolarChart(
chartName, dataset, true, true, false
);
final PolarPlot plot = (PolarPlot) chRt.getPlot();
final DefaultPolarItemRenderer renderer = (DefaultPolarItemRenderer) plot.getRenderer();
renderer.setShapesVisible(false);
//renderer.setShapesFilled(false);
// renderer.setSeriesFilled(0, false);
return chRt;
}
示例12: getDrawingSupplier
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* 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;
}
示例13: drawSeries
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* Plots the data for a given series.
*
* @param g2 the drawing surface.
* @param dataArea the data area.
* @param info collects plot rendering info.
* @param plot the plot.
* @param dataset the dataset.
* @param seriesIndex the series index.
*/
public void drawSeries(Graphics2D g2,
Rectangle2D dataArea,
PlotRenderingInfo info,
PolarPlot plot,
XYDataset dataset,
int seriesIndex) {
Polygon poly = new Polygon();
int numPoints = dataset.getItemCount(seriesIndex);
for (int i = 0; i < numPoints; i++) {
double theta = dataset.getXValue(seriesIndex, i);
double radius = dataset.getYValue(seriesIndex, i);
Point p = plot.translateValueThetaRadiusToJava2D(theta, radius, dataArea);
poly.addPoint(p.x, p.y);
}
g2.setPaint(getSeriesPaint(seriesIndex));
g2.setStroke(getSeriesStroke(seriesIndex));
if (isSeriesFilled(seriesIndex)) {
Composite savedComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
g2.fill(poly);
g2.setComposite(savedComposite);
}
else {
g2.draw(poly);
}
}
示例14: drawRadialGridLines
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* Draw the radial gridlines - the rings.
*
* @param g2 the drawing surface.
* @param plot the plot.
* @param radialAxis the radial axis.
* @param ticks the ticks.
* @param dataArea the data area.
*/
public void drawRadialGridLines(Graphics2D g2,
PolarPlot plot,
ValueAxis radialAxis,
List ticks,
Rectangle2D dataArea) {
g2.setFont(radialAxis.getTickLabelFont());
g2.setPaint(plot.getRadiusGridlinePaint());
g2.setStroke(plot.getRadiusGridlineStroke());
Point center = plot.translateValueThetaRadiusToJava2D(0.0, 0.0, dataArea);
Iterator iterator = ticks.iterator();
while (iterator.hasNext()) {
NumberTick tick = (NumberTick) iterator.next();
Point p = plot.translateValueThetaRadiusToJava2D(
90.0, tick.getNumber().doubleValue(), dataArea
);
int r = p.x - center.x;
int upperLeftX = center.x - r;
int upperLeftY = center.y - r;
int d = 2 * r;
Ellipse2D ring = new Ellipse2D.Double(upperLeftX, upperLeftY, d, d);
g2.setPaint(plot.getRadiusGridlinePaint());
g2.draw(ring);
}
}
示例15: checkChart
import org.jfree.chart.plot.PolarPlot; //导入依赖的package包/类
/**
* Test that the chart is using an xy plot with time as the domain axis.
*
* @param chart the chart.
*/
private void checkChart(JFreeChart chart) {
Plot plot = chart.getPlot();
if (!(plot instanceof PolarPlot)) {
throw new IllegalArgumentException("plot is not a PolarPlot");
}
}