本文整理汇总了Java中org.jfree.chart.plot.PiePlot.setOutlineVisible方法的典型用法代码示例。如果您正苦于以下问题:Java PiePlot.setOutlineVisible方法的具体用法?Java PiePlot.setOutlineVisible怎么用?Java PiePlot.setOutlineVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.plot.PiePlot
的用法示例。
在下文中一共展示了PiePlot.setOutlineVisible方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: generatePieChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
public static JFreeChart generatePieChart()
{
DefaultPieDataset dataSet = new DefaultPieDataset();
dataSet.setValue("China", 30);
dataSet.setValue("India", 30);
dataSet.setValue("United States", 40);
JFreeChart chart = ChartFactory.createPieChart("", dataSet, false, true, false);
PiePlot piePlot = (PiePlot) chart.getPlot();
piePlot.setBackgroundPaint(Color.WHITE); // set background color white
piePlot.setOutlineVisible(false); // remove background border
piePlot.setLabelGenerator(null); // remove pie section labels
piePlot.setSectionPaint("China", Color.GRAY);
piePlot.setSectionPaint("India", Color.GREEN);
piePlot.setSectionPaint("United States", Color.BLUE);
piePlot.setShadowPaint(Color.WHITE);
return chart;
}
示例2: ChartWidget
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
public ChartWidget() {
rightLabel = new JLabel();
Font rightFont = new Font("Verdana", Font.PLAIN, 12);
rightLabel.setHorizontalAlignment(JLabel.LEFT);
rightLabel.setVerticalAlignment(JLabel.TOP);
rightLabel.setFont(rightFont);
this.add(rightLabel);
myColoredPieChart = new DefaultPieDataset();
myColoredChart = ChartFactory.createPieChart3D("", myColoredPieChart,
false, false, false);
myColoredChart.setBorderVisible(false);
myColoredChart.setBackgroundPaint(new Color(0, 0, 0, 0)); // transparent
// black
PiePlot configurator = (PiePlot) myColoredChart.getPlot();
configurator.setBackgroundPaint(new Color(0, 0, 0, 0));
configurator.setLabelGenerator(null);
configurator.setOutlineVisible(false);
ChartPanel chartPanel = new ChartPanel(myColoredChart, 150, 150, 150,
150, 250, 250, true, false, false, false, false, false);
this.add(chartPanel);
}
示例3: erstelleKuchenDiagramm
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
/**
* Erstellt ein Kuchendiagramm aus den Parametern.
*
* @param dataset
* Datenset
* @param titel
* Titel
* @return {@link JFreeChart}
*/
private JFreeChart erstelleKuchenDiagramm(PieDataset dataset, String titel) {
JFreeChart chart = ChartFactory.createPieChart3D(titel, dataset, true,
true, false);
TextTitle t = chart.getTitle();
t.setHorizontalAlignment(HorizontalAlignment.CENTER);
t.setFont(new Font("Arial", Font.CENTER_BASELINE, 26));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(null);
plot.setInteriorGap(0.04);
plot.setOutlineVisible(false);
for (Partei partei : parteienListe) {
if (partei.getFarbe() != null) {
plot.setSectionPaint(
partei.getName(),
createGradientPaint(partei.getFarbe(),
partei.getFarbe()));
}
}
plot.setBaseSectionOutlinePaint(Color.GRAY);
plot.setLabelFont(new Font("Arial", Font.BOLD, 15));
plot.setLabelLinkPaint(Color.black);
plot.setLabelPaint(Color.black);
plot.setLabelBackgroundPaint(null);
return chart;
}
示例4: renderChartToFile
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
private Image renderChartToFile(TotalPaymentSummaryReportResponse response, File chartFile) throws IOException,
BadElementException, MalformedURLException {
// For generating pie chart for total payments(example for total deposits) perform following:
// Create the dataset
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Pre 10/82 Deposit", response.getTotalDepositsPre1082());
dataset.setValue("Pre 10/82 Redeposit", response.getTotalRedepositsPre1082());
dataset.setValue("CSRS: Post 9/82 Deposit", response.getCsrsDepositsPost982());
dataset.setValue("FERS Postal", response.getFersPostalDepositsPost982());
dataset.setValue("FERS Non Postal", response.getFersNonPostalDepositsPost982());
dataset.setValue("Post 9/82 Deposit", response.getTotalDepositsPost982());
dataset.setValue("Post 9/82 Redeposit", response.getTotalRedepositsPost982());
// Set following data
// Create the chart
JFreeChart chart = ChartFactory.createPieChart("Total Payments", dataset, true, true, false);
PiePlot plot = (PiePlot) chart.getPlot();
plot.setLabelFont(new Font("Helvetica", 0, 10));
plot.setBackgroundPaint(Color.white);
plot.setIgnoreZeroValues(false);
plot.setOutlineVisible(false);
chart.getTitle().setFont(new Font("Helvetica", 1, 14));
LegendTitle legend = chart.getLegend();
legend.setItemFont(new Font("Helvetica", 0, 10));
legend.setPosition(RectangleEdge.RIGHT);
ChartUtilities.saveChartAsPNG(chartFile, chart, chartWidth, chartHeight);
Image image = Image.getInstance(chartFile.getAbsolutePath());
return image;
}
开发者ID:NASA-Tournament-Lab,项目名称:CoECI-OPM-Service-Credit-Redeposit-Deposit-Application,代码行数:35,代码来源:TotalPaymentSummaryReportService.java
示例5: createChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the dataset.
*
* @return A chart.
*/
private static JFreeChart createChart(PieDataset dataset) {
JFreeChart chart = ChartFactory.createPieChart(
"Smart Phones Manufactured / Q3 2011", dataset);
// set a custom background for the chart
chart.setBackgroundPaint(new GradientPaint(new Point(0, 0),
new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY));
// customise the title position and font
TextTitle t = chart.getTitle();
t.setHorizontalAlignment(HorizontalAlignment.LEFT);
t.setPaint(new Color(240, 240, 240));
t.setFont(new Font("Arial", Font.BOLD, 26));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(null);
plot.setInteriorGap(0.04);
plot.setOutlineVisible(false);
// use gradients and white borders for the section colours
plot.setSectionPaint("Others", createGradientPaint(new Color(200, 200, 255), Color.BLUE));
plot.setSectionPaint("Samsung", createGradientPaint(new Color(255, 200, 200), Color.RED));
plot.setSectionPaint("Apple", createGradientPaint(new Color(200, 255, 200), Color.GREEN));
plot.setSectionPaint("Nokia", createGradientPaint(new Color(200, 255, 200), Color.YELLOW));
plot.setDefaultSectionOutlinePaint(Color.WHITE);
plot.setSectionOutlinesVisible(true);
plot.setDefaultSectionOutlineStroke(new BasicStroke(2.0f));
// customise the section label appearance
plot.setLabelFont(new Font("Courier New", Font.BOLD, 20));
plot.setLabelLinkPaint(Color.WHITE);
plot.setLabelLinkStroke(new BasicStroke(2.0f));
plot.setLabelOutlineStroke(null);
plot.setLabelPaint(Color.WHITE);
plot.setLabelBackgroundPaint(null);
// add a subtitle giving the data source
TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523",
new Font("Courier New", Font.PLAIN, 12));
source.setPaint(Color.WHITE);
source.setPosition(RectangleEdge.BOTTOM);
source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
chart.addSubtitle(source);
return chart;
}
示例6: createChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the dataset.
*
* @return A chart.
*/
private static JFreeChart createChart(PieDataset dataset) {
JFreeChart chart = ChartFactory.createPieChart(
"Smart Phones Manufactured / Q3 2011", // chart title
dataset, // data
false, // no legend
true, // tooltips
false // no URL generation
);
// set a custom background for the chart
chart.setBackgroundPaint(new GradientPaint(new Point(0, 0),
new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY));
// customise the title position and font
TextTitle t = chart.getTitle();
t.setHorizontalAlignment(HorizontalAlignment.LEFT);
t.setPaint(new Color(240, 240, 240));
t.setFont(new Font("Arial", Font.BOLD, 26));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(null);
plot.setInteriorGap(0.04);
plot.setOutlineVisible(false);
// use gradients and white borders for the section colours
plot.setSectionPaint("Others", createGradientPaint(new Color(200, 200, 255), Color.BLUE));
plot.setSectionPaint("Samsung", createGradientPaint(new Color(255, 200, 200), Color.RED));
plot.setSectionPaint("Apple", createGradientPaint(new Color(200, 255, 200), Color.GREEN));
plot.setSectionPaint("Nokia", createGradientPaint(new Color(200, 255, 200), Color.YELLOW));
plot.setBaseSectionOutlinePaint(Color.WHITE);
plot.setSectionOutlinesVisible(true);
plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f));
// customise the section label appearance
plot.setLabelFont(new Font("Courier New", Font.BOLD, 20));
plot.setLabelLinkPaint(Color.WHITE);
plot.setLabelLinkStroke(new BasicStroke(2.0f));
plot.setLabelOutlineStroke(null);
plot.setLabelPaint(Color.WHITE);
plot.setLabelBackgroundPaint(null);
// add a subtitle giving the data source
TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523",
new Font("Courier New", Font.PLAIN, 12));
source.setPaint(Color.WHITE);
source.setPosition(RectangleEdge.BOTTOM);
source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
chart.addSubtitle(source);
return chart;
}
示例7: renderChartInfo
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
private void renderChartInfo() {
Hashtable<Object, Marker> marks = new Hashtable<>();
DefaultPieDataset dataset = buildDataset(marks);
JFreeChart chart = ChartFactory.createPieChart(
null, // chart title
dataset, // data
true, // include legend
true,
false);
chart.setBackgroundPaint(null);
//chart.setBorderStroke(null);
chart.setBorderVisible(false);
final PiePlot plot = (PiePlot) chart.getPlot();
// plot.setBackgroundPaint(null);
// plot.setShadowPaint(null);
Enumeration<Object> markKeys = marks.keys();
while (markKeys.hasMoreElements()) {
if (iCurrentView == ID_ALLY_CHART) {
Ally a = (Ally) markKeys.nextElement();
plot.setSectionPaint(a.getTag(), marks.get(a).getMarkerColor());
} else {
Tribe t = (Tribe) markKeys.nextElement();
plot.setSectionPaint(t.getName(), marks.get(t).getMarkerColor());
}
}
//plot.setCircular(true);
// plot.setMaximumLabelWidth(30.0);
/*
* plot.setLabelGenerator(new StandardPieSectionLabelGenerator( "{0} = {2}", NumberFormat.getNumberInstance(),
* NumberFormat.getPercentInstance()));
*/
// chart.getLegend().setVerticalAlignment(VerticalAlignment.CENTER);
// chart.getLegend().setPosition(RectangleEdge.RIGHT);
// plot.setMaximumLabelWidth(20.0);
plot.setLabelGenerator(null);
plot.setBackgroundPaint(Constants.DS_BACK);
/*
* plot.setInteriorGap(0.0); plot.setLabelGap(0.0);
*/
plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator(
"{0} = {2}", NumberFormat.getNumberInstance(), NumberFormat.getPercentInstance()));
/*
* plot.getL plot.setLabelFont(g2d.getFont().deriveFont(10.0f));
*/
//plot.setLabelGenerator(null);
//plot.setMaximumLabelWidth(30.0);
//plot.getLabelDistributor().distributeLabels(10.0, 20.0);
//chart.draw(g2d, new Rectangle2D.Float(20, 20, 100, 100));
// g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
plot.setOutlineVisible(false);
mChartImage = chart.createBufferedImage(getWidth(), getHeight());
//chart.draw(g2d, new Rectangle2D.Float(50, 50, 400, 400));
//g2d.drawImage(bi, 30, 30, null);
// g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, alpha));
//bi = chart.createBufferedImage(240, 240);
// g2d.drawImage(bi, 30, 30, null);
}
示例8: createChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the dataset.
* @return A chart.
*/
private static JFreeChart createChart(PieDataset dataset) {
JFreeChart chart = ChartFactory.createPieChart("Smart Phones Manufactured / Q3 2011", // chart title
dataset, // data
false, // no legend
true, // tooltips
false // no URL generation
);
// set a custom background for the chart
chart.setBackgroundPaint(new GradientPaint(new Point(0, 0), new Color(20, 20, 20), new Point(400, 200),
Color.DARK_GRAY));
// customise the title position and font
TextTitle t = chart.getTitle();
t.setHorizontalAlignment(HorizontalAlignment.LEFT);
t.setPaint(new Color(240, 240, 240));
t.setFont(new Font(JFreeChart.getFont(), Font.BOLD, 26));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(null);
plot.setInteriorGap(0.04);
plot.setOutlineVisible(false);
// use gradients and white borders for the section colours
plot.setSectionPaint("Others", createGradientPaint(new Color(200, 200, 255), Color.BLUE));
plot.setSectionPaint("Samsung", createGradientPaint(new Color(255, 200, 200), Color.RED));
plot.setSectionPaint("Apple", createGradientPaint(new Color(200, 255, 200), Color.GREEN));
plot.setSectionPaint("Nokia", createGradientPaint(new Color(200, 255, 200), Color.YELLOW));
plot.setBaseSectionOutlinePaint(Color.WHITE);
plot.setSectionOutlinesVisible(true);
plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f));
// customise the section label appearance
plot.setLabelFont(new Font(JFreeChart.getFont(), Font.BOLD, 20));
plot.setLabelLinkPaint(Color.WHITE);
plot.setLabelLinkStroke(new BasicStroke(2.0f));
plot.setLabelOutlineStroke(null);
plot.setLabelPaint(Color.WHITE);
plot.setLabelBackgroundPaint(null);
// add a subtitle giving the data source
TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523", new Font(JFreeChart.getFont(),
Font.PLAIN, 12));
source.setPaint(Color.WHITE);
source.setPosition(RectangleEdge.BOTTOM);
source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
chart.addSubtitle(source);
return chart;
}
示例9: createChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
/**
* A JFreeChart is created with the input data.
* @param dataset - data to show in the chart.
* @return - JFreeChart
*/
private JFreeChart createChart(PieDataset dataset,int numCalls) {
JFreeChart chart = ChartFactory.createPieChart(
NUM_CALLS + numCalls, // chart
dataset, // data
false, // no legend
false, // tooltips
false // no URL generation
);
// set a custom background for the chart
chart.setBackgroundPaint(new GradientPaint(new Point(0, 0),
new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY));
// customise the title position and font
TextTitle t = chart.getTitle();
t.setPaint(new Color(240, 240, 240));
t.setFont(new Font(FONT_TITLE, Font.BOLD,FONT_SIZE_TITLE ));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(null);
plot.setInteriorGap(0.04);
plot.setOutlineVisible(false);
// use gradients and white borders for the section colours
plot.setBaseSectionOutlinePaint(Color.WHITE);
plot.setSectionOutlinesVisible(true);
plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f));
// customise the section label appearance
plot.setLabelFont(new Font(PIE_FONT, Font.BOLD, FONT_SIZE_LABEL_PLOT ));
plot.setLabelLinkPaint(Color.WHITE);
plot.setLabelLinkStroke(new BasicStroke(2.0f));
plot.setLabelOutlineStroke(null);
plot.setLabelPaint(Color.WHITE);
plot.setLabelBackgroundPaint(null);
plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} - {2}"));
return chart;
}
示例10: createChart
import org.jfree.chart.plot.PiePlot; //导入方法依赖的package包/类
/**
* A JFreeChart is created with the input data.
* @param dataset - data to show in the chart.
* @return - JFreeChart
*/
private JFreeChart createChart(PieDataset dataset) {
JFreeChart chart = ChartFactory.createPieChart(
"", // chart title
dataset, // data
false, // no legend
false, // tooltips
false // no URL generation
);
// set a custom background for the chart
chart.setBackgroundPaint(new GradientPaint(new Point(0, 0),
new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY));
// customise the title position and font
TextTitle t = chart.getTitle();
t.setPaint(new Color(240, 240, 240));
t.setFont(new Font(FONT_TITLE, Font.BOLD, 26));
PiePlot plot = (PiePlot) chart.getPlot();
plot.setBackgroundPaint(null);
plot.setInteriorGap(0.04);
plot.setOutlineVisible(false);
// use gradients and white borders for the section colours
plot.setBaseSectionOutlinePaint(Color.WHITE);
plot.setSectionOutlinesVisible(true);
plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f));
// customise the section label appearance
plot.setLabelFont(new Font(PIE_FONT, Font.BOLD, 16));
plot.setLabelLinkPaint(Color.WHITE);
plot.setLabelLinkStroke(new BasicStroke(2.0f));
plot.setLabelOutlineStroke(null);
plot.setLabelPaint(Color.WHITE);
plot.setLabelBackgroundPaint(null);
plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} - {2}"));
return chart;
}