本文整理汇总了Java中org.jfree.chart.plot.RingPlot类的典型用法代码示例。如果您正苦于以下问题:Java RingPlot类的具体用法?Java RingPlot怎么用?Java RingPlot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RingPlot类属于org.jfree.chart.plot包,在下文中一共展示了RingPlot类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRingChart
import org.jfree.chart.plot.RingPlot; //导入依赖的package包/类
/**
* Creates a ring chart with default settings.
* <P>
* The chart object returned by this method uses a {@link RingPlot}
* instance as the plot.
*
* @param title the chart title (<code>null</code> permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param legend a flag specifying whether or not a legend is required.
* @param tooltips configure chart to generate tool tips?
* @param urls configure chart to generate URLs?
*
* @return A pie chart.
*/
public static JFreeChart createRingChart(String title,
PieDataset dataset,
boolean legend,
boolean tooltips,
boolean urls) {
RingPlot plot = new RingPlot(dataset);
plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
if (tooltips) {
plot.setToolTipGenerator(new StandardPieToolTipGenerator(
StandardPieToolTipGenerator.DEFAULT_SECTION_LABEL_FORMAT));
}
if (urls) {
plot.setURLGenerator(new StandardPieURLGenerator());
}
return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot,
legend);
}
示例2: createRingChart
import org.jfree.chart.plot.RingPlot; //导入依赖的package包/类
/**
* Creates a ring chart with default settings.
* <P>
* The chart object returned by this method uses a {@link RingPlot}
* instance as the plot.
*
* @param title the chart title (<code>null</code> permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param legend a flag specifying whether or not a legend is required.
* @param tooltips configure chart to generate tool tips?
* @param urls configure chart to generate URLs?
*
* @return A ring chart.
*/
public static JFreeChart createRingChart(String title, PieDataset dataset,
boolean legend, boolean tooltips, boolean urls) {
RingPlot plot = new RingPlot(dataset);
plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
if (tooltips) {
plot.setToolTipGenerator(new StandardPieToolTipGenerator());
}
if (urls) {
plot.setURLGenerator(new StandardPieURLGenerator());
}
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例3: createRingChart
import org.jfree.chart.plot.RingPlot; //导入依赖的package包/类
/**
* Creates a ring chart with default settings.
* <P>
* The chart object returned by this method uses a {@link RingPlot}
* instance as the plot.
*
* @param title the chart title ({@code null} permitted).
* @param dataset the dataset for the chart ({@code null} permitted).
* @param legend a flag specifying whether or not a legend is required.
* @param tooltips configure chart to generate tool tips?
* @param urls configure chart to generate URLs?
*
* @return A ring chart.
*/
public static JFreeChart createRingChart(String title, PieDataset dataset,
boolean legend, boolean tooltips, boolean urls) {
RingPlot plot = new RingPlot(dataset);
plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
if (tooltips) {
plot.setToolTipGenerator(new StandardPieToolTipGenerator());
}
if (urls) {
plot.setURLGenerator(new StandardPieURLGenerator());
}
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例4: createRingChart
import org.jfree.chart.plot.RingPlot; //导入依赖的package包/类
/**
* Creates a ring chart with default settings.
* <P>
* The chart object returned by this method uses a {@link RingPlot}
* instance as the plot.
*
* @param title the chart title (<code>null</code> permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param legend a flag specifying whether or not a legend is required.
* @param tooltips configure chart to generate tool tips?
* @param urls configure chart to generate URLs?
*
* @return A ring chart.
*/
public static JFreeChart createRingChart(String title,
PieDataset dataset,
boolean legend,
boolean tooltips,
boolean urls) {
RingPlot plot = new RingPlot(dataset);
plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
if (tooltips) {
plot.setToolTipGenerator(new StandardPieToolTipGenerator());
}
if (urls) {
plot.setURLGenerator(new StandardPieURLGenerator());
}
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例5: createRingChart
import org.jfree.chart.plot.RingPlot; //导入依赖的package包/类
private JFreeChart createRingChart(ReportChart reportChart,
ChartValue[] values, boolean displayInline)
{
PieDataset dataset = createPieDataset(values);
RingPlot plot = new RingPlot(dataset);
plot.setToolTipGenerator(new StandardPieToolTipGenerator());
if (reportChart.getDrillDownReport() != null)
{
plot.setURLGenerator(new StandardPieURLGenerator(
"executeReport.action?displayInline=" + displayInline
+ "&exportType=0&reportId="
+ reportChart.getDrillDownReport().getId(),
ReportChart.DRILLDOWN_PARAMETER, "pieIndex"));
}
JFreeChart chart = new JFreeChart(reportChart.getTitle(),
JFreeChart.DEFAULT_TITLE_FONT, plot, reportChart.isShowLegend());
return chart;
}
示例6: createRingChart
import org.jfree.chart.plot.RingPlot; //导入依赖的package包/类
private JFreeChart createRingChart(ReportChart reportChart,
ChartValue[] values, boolean displayInline)
{
PieDataset dataset = createPieDataset(values);
RingPlot plot = new RingPlot(dataset);
plot.setToolTipGenerator(new StandardPieToolTipGenerator());
if (reportChart.getDrillDownReport() != null)
{
plot.setURLGenerator(new StandardPieURLGenerator(
"executeReport.action?displayInline=" + displayInline
+ "&exportType=0&reportId="
+ reportChart.getDrillDownReport().getId(),
ReportChart.DRILLDOWN_PARAMETER, "pieIndex"));
}
JFreeChart chart = new JFreeChart(reportChart.getTitle(),
JFreeChart.DEFAULT_TITLE_FONT, plot, reportChart.isShowLegend());
return chart;
}
示例7: createChart
import org.jfree.chart.plot.RingPlot; //导入依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the dataset.
*
* @return a chart.
*/
protected JFreeChart createChart(PieDataset dataset) {
JFreeChart chart = ChartFactory.createRingChart(
chartTitle, // chart title
dataset, // data
!legendPanelOn, // include legend
true,
false
);
RingPlot plot = (RingPlot) chart.getPlot();
plot.setLabelFont(new Font("SansSerif", Font.PLAIN, 12));
plot.setNoDataMessage("No data available");
plot.setCircular(false);
plot.setLabelGap(0.02);
for (int i=0; i<pulloutFlag.length; i++){
//System.out.println("\""+pulloutFlag[i]+"\"");
if (isPullout(i)){
Comparable key = dataset.getKey(i);
plot.setExplodePercent(key, 0.30);
}
}
if(rotateOn){
Rotator rotator = new Rotator(plot);
rotator.start();
}
setCategorySummary(dataset);
return chart;
}
示例8: testEquals
import org.jfree.chart.plot.RingPlot; //导入依赖的package包/类
/**
* Some checks for the equals() method.
*/
public void testEquals() {
RingPlot plot1 = new RingPlot(null);
RingPlot plot2 = new RingPlot(null);
assertTrue(plot1.equals(plot2));
assertTrue(plot2.equals(plot1));
// separatorsVisible
plot1.setSeparatorsVisible(false);
assertFalse(plot1.equals(plot2));
plot2.setSeparatorsVisible(false);
assertTrue(plot1.equals(plot2));
// separatorStroke
Stroke s = new BasicStroke(1.1f);
plot1.setSeparatorStroke(s);
assertFalse(plot1.equals(plot2));
plot2.setSeparatorStroke(s);
assertTrue(plot1.equals(plot2));
// separatorPaint
plot1.setSeparatorPaint(new GradientPaint(1.0f, 2.0f, Color.red,
2.0f, 1.0f, Color.blue));
assertFalse(plot1.equals(plot2));
plot2.setSeparatorPaint(new GradientPaint(1.0f, 2.0f, Color.red,
2.0f, 1.0f, Color.blue));
assertTrue(plot1.equals(plot2));
// innerSeparatorExtension
plot1.setInnerSeparatorExtension(0.01);
assertFalse(plot1.equals(plot2));
plot2.setInnerSeparatorExtension(0.01);
assertTrue(plot1.equals(plot2));
// outerSeparatorExtension
plot1.setOuterSeparatorExtension(0.02);
assertFalse(plot1.equals(plot2));
plot2.setOuterSeparatorExtension(0.02);
assertTrue(plot1.equals(plot2));
// sectionDepth
plot1.setSectionDepth(0.12);
assertFalse(plot1.equals(plot2));
plot2.setSectionDepth(0.12);
assertTrue(plot1.equals(plot2));
}
示例9: testEquals
import org.jfree.chart.plot.RingPlot; //导入依赖的package包/类
/**
* Some checks for the equals() method.
*/
public void testEquals() {
RingPlot plot1 = new RingPlot(null);
RingPlot plot2 = new RingPlot(null);
assertTrue(plot1.equals(plot2));
assertTrue(plot2.equals(plot1));
// separatorsVisible
plot1.setSeparatorsVisible(false);
assertFalse(plot1.equals(plot2));
plot2.setSeparatorsVisible(false);
assertTrue(plot1.equals(plot2));
// separatorStroke
Stroke s = new BasicStroke(1.1f);
plot1.setSeparatorStroke(s);
assertFalse(plot1.equals(plot2));
plot2.setSeparatorStroke(s);
assertTrue(plot1.equals(plot2));
// separatorPaint
plot1.setSeparatorPaint(new GradientPaint(1.0f, 2.0f, Color.red,
2.0f, 1.0f, Color.blue));
assertFalse(plot1.equals(plot2));
plot2.setSeparatorPaint(new GradientPaint(1.0f, 2.0f, Color.red,
2.0f, 1.0f, Color.blue));
assertTrue(plot1.equals(plot2));
// innerSeparatorExtension
plot1.setInnerSeparatorExtension(0.01);
assertFalse(plot1.equals(plot2));
plot2.setInnerSeparatorExtension(0.01);
assertTrue(plot1.equals(plot2));
// outerSeparatorExtension
plot1.setOuterSeparatorExtension(0.02);
assertFalse(plot1.equals(plot2));
plot2.setOuterSeparatorExtension(0.02);
assertTrue(plot1.equals(plot2));
// sectionDepth
plot1.setSectionDepth(0.12);
assertFalse(plot1.equals(plot2));
plot2.setSectionDepth(0.12);
assertTrue(plot1.equals(plot2));
}
示例10: createRingChart
import org.jfree.chart.plot.RingPlot; //导入依赖的package包/类
/**
* Creates a ring chart with default settings.
* <P>
* The chart object returned by this method uses a {@link RingPlot}
* instance as the plot.
*
* @param title the chart title (<code>null</code> permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param legend a flag specifying whether or not a legend is required.
* @param locale the locale (<code>null</code> not permitted).
*
* @return A ring chart.
*
* @since 1.0.7
*/
public static JFreeChart createRingChart(String title, PieDataset dataset,
boolean legend, Locale locale) {
RingPlot plot = new RingPlot(dataset);
plot.setLabelGenerator(new StandardPieSectionLabelGenerator(locale));
plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
plot.setToolTipGenerator(new StandardPieToolTipGenerator(locale));
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}