本文整理汇总了Java中org.jfree.chart.plot.SpiderWebPlot类的典型用法代码示例。如果您正苦于以下问题:Java SpiderWebPlot类的具体用法?Java SpiderWebPlot怎么用?Java SpiderWebPlot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpiderWebPlot类属于org.jfree.chart.plot包,在下文中一共展示了SpiderWebPlot类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDrawWithNullInfo
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
/**
* Draws the chart with a null info object to make sure that no exceptions
* are thrown.
*/
public void testDrawWithNullInfo() {
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(35.0, "S1", "C1");
dataset.addValue(45.0, "S1", "C2");
dataset.addValue(55.0, "S1", "C3");
dataset.addValue(15.0, "S1", "C4");
dataset.addValue(25.0, "S1", "C5");
SpiderWebPlot plot = new SpiderWebPlot(dataset);
JFreeChart chart = new JFreeChart(plot);
boolean success = false;
try {
BufferedImage image = new BufferedImage(200 , 100,
BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = image.createGraphics();
chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
g2.dispose();
success = true;
}
catch (Exception e) {
success = false;
}
assertTrue(success);
}
示例2: resetRenderer
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
protected void resetRenderer(final IScope scope, final String serieid) {
final SpiderWebPlot plot = (SpiderWebPlot) this.chart.getPlot();
final ChartDataSeries myserie = this.getChartdataset().getDataSeries(scope, serieid);
if (!IdPosition.containsKey(serieid)) {
// System.out.println("pb!!!");
} else {
final int myrow = IdPosition.get(serieid);
if (myserie.getMycolor() != null) {
plot.setSeriesPaint(myrow, myserie.getMycolor());
}
if (this.series_label_position.equals("onchart")) {
//// newr.setBaseItemLabelGenerator(new LabelGenerator());
// ItemLabelPosition itemlabelposition = new
//// ItemLabelPosition(ItemLabelAnchor.OUTSIDE12,
//// TextAnchor.BOTTOM_CENTER);
// newr.setBasePositiveItemLabelPosition(itemlabelposition);
// newr.setBaseNegativeItemLabelPosition(itemlabelposition);
// newr.setBaseItemLabelsVisible(true);
}
}
}
示例3: clearDataSet
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
@Override
protected void clearDataSet(final IScope scope) {
// TODO Auto-generated method stub
super.clearDataSet(scope);
final SpiderWebPlot plot = (SpiderWebPlot) this.chart.getPlot();
for (int i = plot.getDataset().getRowCount() - 1; i >= 1; i--) {
// plot.setDataset(i, null);
// plot.setRenderer(i, null);
}
if (jfreedataset.size() > 0)
((DefaultCategoryDataset) jfreedataset.get(0)).clear();
jfreedataset.clear();
jfreedataset.add(0, new DefaultCategoryDataset());
plot.setDataset((DefaultCategoryDataset) jfreedataset.get(0));
IdPosition.clear();
nbseries = 0;
}
示例4: testDrawWithNullInfo
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
/**
* Draws the chart with a null info object to make sure that no exceptions
* are thrown.
*/
public void testDrawWithNullInfo() {
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(35.0, "S1", "C1");
dataset.addValue(45.0, "S1", "C2");
dataset.addValue(55.0, "S1", "C3");
dataset.addValue(15.0, "S1", "C4");
dataset.addValue(25.0, "S1", "C5");
SpiderWebPlot plot = new SpiderWebPlot(dataset);
JFreeChart chart = new JFreeChart(plot);
boolean success = false;
try {
BufferedImage image = new BufferedImage(200 , 100,
BufferedImage.TYPE_INT_RGB);
Graphics2D g2 = image.createGraphics();
chart.draw(g2, new Rectangle2D.Double(0, 0, 200, 100), null, null);
g2.dispose();
success = true;
}
catch (Exception e) {
success = false;
}
assertTrue(success);
}
示例5: getRadarChart
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
private JFreeChart getRadarChart( BaseChart chart, CategoryDataset dataSet )
{
SpiderWebPlot plot = new SpiderWebPlot( dataSet, TableOrder.BY_ROW );
plot.setLabelFont( LABEL_FONT );
JFreeChart radarChart = new JFreeChart( chart.getName(), TITLE_FONT, plot, !chart.isHideLegend() );
setBasicConfig( radarChart, chart );
return radarChart;
}
示例6: createChart
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
@Override
public void createChart(final IScope scope) {
super.createChart(scope);
final SpiderWebPlot plot = new SpiderWebPlot((CategoryDataset) createDataset(scope));
chart = new JFreeChart(getName(), null, plot, true);
}
示例7: createNewSerie
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
@Override
protected void createNewSerie(final IScope scope, final String serieid) {
// final ChartDataSeries dataserie = chartdataset.getDataSeries(scope,
// serieid);
// final XYIntervalSeries serie = new
// XYIntervalSeries(dataserie.getSerieLegend(scope), false, true);
final SpiderWebPlot plot = (SpiderWebPlot) this.chart.getPlot();
final DefaultCategoryDataset firstdataset = (DefaultCategoryDataset) plot.getDataset();
if (nbseries == 0) {
plot.setDataset(firstdataset);
} else {
// DefaultCategoryDataset newdataset=new DefaultCategoryDataset();
// jfreedataset.add(newdataset);
// plot.setDataset(jfreedataset.size()-1, newdataset);
// plot.setDataset(nbseries, firstdataset);
}
nbseries++;
// plot.setRenderer(nbseries-1,
// (CategoryItemRenderer)getOrCreateRenderer(scope,serieid));
IdPosition.put(serieid, nbseries - 1);
// System.out.println("new serie"+serieid+" at
// "+IdPosition.get(serieid)+" fdsize "+plot.getCategories().size()+"
// jfds "+jfreedataset.size()+" datasc "+plot.getDatasetCount()+" nbse
// "+nbseries);
// TODO Auto-generated method stub
}
示例8: setupChart
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
/**
* Basic setup of a chart.
*
* @param dataset
* dataset for the chart
*/
private JFreeChart setupChart(DefaultCategoryDataset dataset) {
SpiderWebPlot plot = new SpiderWebPlot(dataset);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, drawLegend);
return chart;
}
示例9: applyToPlot
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
/**
* Applies the attributes of this theme to a plot.
*
* @param plot the plot (<code>null</code>).
*/
protected void applyToPlot(Plot plot) {
ParamChecks.nullNotPermitted(plot, "plot");
if (plot.getDrawingSupplier() != null) {
plot.setDrawingSupplier(getDrawingSupplier());
}
if (plot.getBackgroundPaint() != null) {
plot.setBackgroundPaint(this.plotBackgroundPaint);
}
plot.setOutlinePaint(this.plotOutlinePaint);
// now handle specific plot types (and yes, I know this is some
// really ugly code that has to be manually updated any time a new
// plot type is added - I should have written something much cooler,
// but I didn't and neither did anyone else).
if (plot instanceof PiePlot) {
applyToPiePlot((PiePlot) plot);
}
else if (plot instanceof MultiplePiePlot) {
applyToMultiplePiePlot((MultiplePiePlot) plot);
}
else if (plot instanceof CategoryPlot) {
applyToCategoryPlot((CategoryPlot) plot);
}
else if (plot instanceof XYPlot) {
applyToXYPlot((XYPlot) plot);
}
else if (plot instanceof FastScatterPlot) {
applyToFastScatterPlot((FastScatterPlot) plot);
}
else if (plot instanceof MeterPlot) {
applyToMeterPlot((MeterPlot) plot);
}
else if (plot instanceof ThermometerPlot) {
applyToThermometerPlot((ThermometerPlot) plot);
}
else if (plot instanceof SpiderWebPlot) {
applyToSpiderWebPlot((SpiderWebPlot) plot);
}
else if (plot instanceof PolarPlot) {
applyToPolarPlot((PolarPlot) plot);
}
}
示例10: applyToSpiderWebPlot
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
/**
* Applies the attributes of this theme to a {@link SpiderWebPlot}.
*
* @param plot the plot (<code>null</code> not permitted).
*/
protected void applyToSpiderWebPlot(SpiderWebPlot plot) {
plot.setLabelFont(this.regularFont);
plot.setLabelPaint(this.axisLabelPaint);
plot.setAxisLinePaint(this.axisLabelPaint);
}
示例11: applyToPlot
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
/**
* Applies the attributes of this theme to a plot.
*
* @param plot the plot ({@code null}).
*/
protected void applyToPlot(Plot plot) {
Args.nullNotPermitted(plot, "plot");
if (plot.getDrawingSupplier() != null) {
plot.setDrawingSupplier(getDrawingSupplier());
}
if (plot.getBackgroundPaint() != null) {
plot.setBackgroundPaint(this.plotBackgroundPaint);
}
plot.setOutlinePaint(this.plotOutlinePaint);
// now handle specific plot types (and yes, I know this is some
// really ugly code that has to be manually updated any time a new
// plot type is added - I should have written something much cooler,
// but I didn't and neither did anyone else).
if (plot instanceof PiePlot) {
applyToPiePlot((PiePlot) plot);
}
else if (plot instanceof MultiplePiePlot) {
applyToMultiplePiePlot((MultiplePiePlot) plot);
}
else if (plot instanceof CategoryPlot) {
applyToCategoryPlot((CategoryPlot) plot);
}
else if (plot instanceof XYPlot) {
applyToXYPlot((XYPlot) plot);
}
else if (plot instanceof FastScatterPlot) {
applyToFastScatterPlot((FastScatterPlot) plot);
}
else if (plot instanceof MeterPlot) {
applyToMeterPlot((MeterPlot) plot);
}
else if (plot instanceof ThermometerPlot) {
applyToThermometerPlot((ThermometerPlot) plot);
}
else if (plot instanceof SpiderWebPlot) {
applyToSpiderWebPlot((SpiderWebPlot) plot);
}
else if (plot instanceof PolarPlot) {
applyToPolarPlot((PolarPlot) plot);
}
}
示例12: applyToSpiderWebPlot
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
/**
* Applies the attributes of this theme to a {@link SpiderWebPlot}.
*
* @param plot the plot ({@code null} not permitted).
*/
protected void applyToSpiderWebPlot(SpiderWebPlot plot) {
plot.setLabelFont(this.regularFont);
plot.setLabelPaint(this.axisLabelPaint);
plot.setAxisLinePaint(this.axisLabelPaint);
}
示例13: applyToPlot
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
/**
* Applies the attributes of this theme to a plot.
*
* @param plot the plot (<code>null</code>).
*/
protected void applyToPlot(Plot plot) {
if (plot == null) {
throw new IllegalArgumentException("Null 'plot' argument.");
}
if (plot.getDrawingSupplier() != null) {
plot.setDrawingSupplier(getDrawingSupplier());
}
if (plot.getBackgroundPaint() != null) {
plot.setBackgroundPaint(this.plotBackgroundPaint);
}
plot.setOutlinePaint(this.plotOutlinePaint);
// now handle specific plot types (and yes, I know this is some
// really ugly code that has to be manually updated any time a new
// plot type is added - I should have written something much cooler,
// but I didn't and neither did anyone else).
if (plot instanceof PiePlot) {
applyToPiePlot((PiePlot) plot);
}
else if (plot instanceof MultiplePiePlot) {
applyToMultiplePiePlot((MultiplePiePlot) plot);
}
else if (plot instanceof CategoryPlot) {
applyToCategoryPlot((CategoryPlot) plot);
}
else if (plot instanceof XYPlot) {
applyToXYPlot((XYPlot) plot);
}
else if (plot instanceof FastScatterPlot) {
applyToFastScatterPlot((FastScatterPlot) plot);
}
else if (plot instanceof MeterPlot) {
applyToMeterPlot((MeterPlot) plot);
}
else if (plot instanceof ThermometerPlot) {
applyToThermometerPlot((ThermometerPlot) plot);
}
else if (plot instanceof SpiderWebPlot) {
applyToSpiderWebPlot((SpiderWebPlot) plot);
}
else if (plot instanceof PolarPlot) {
applyToPolarPlot((PolarPlot) plot);
}
}
示例14: initChart_post_data_init
import org.jfree.chart.plot.SpiderWebPlot; //导入依赖的package包/类
@Override
public void initChart_post_data_init(final IScope scope) {
// TODO Auto-generated method stub
super.initChart_post_data_init(scope);
final SpiderWebPlot pp = (SpiderWebPlot) chart.getPlot();
// final String sty = getStyle();
// this.useSubAxis=false;
// switch (sty) {
// default: {
if (this.series_label_position.equals("default")) {
this.series_label_position = "legend";
}
// break;
// }
// }
if (this.series_label_position.equals("xaxis")) {
// this.useSubAxis=true;
}
if (!this.series_label_position.equals("legend")) {
chart.getLegend().setVisible(false);
// legend is useless, but I find it nice anyway... Could put back...
}
this.resetDomainAxis(scope);
pp.setAxisLinePaint(axesColor);
pp.setLabelFont(getLabelFont());
if (textColor != null) {
pp.setLabelPaint(textColor);
}
if (ylabel != null && ylabel != "") {}
if (this.series_label_position.equals("yaxis")) {
// pp.getRangeAxis().setLabel(this.getChartdataset().getDataSeriesIds(scope).iterator().next());
chart.getLegend().setVisible(false);
}
chart.getLegend().setVisible(true);
if (xlabel != null && xlabel != "") {
// pp.getDomainAxis().setLabel(xlabel);
}
if (this.series_label_position.equals("none"))
pp.setLabelPaint(this.backgroundColor);
}