当前位置: 首页>>代码示例>>Java>>正文


Java PiePlot.setLabelOutlineStroke方法代码示例

本文整理汇总了Java中org.jfree.chart.plot.PiePlot.setLabelOutlineStroke方法的典型用法代码示例。如果您正苦于以下问题:Java PiePlot.setLabelOutlineStroke方法的具体用法?Java PiePlot.setLabelOutlineStroke怎么用?Java PiePlot.setLabelOutlineStroke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.plot.PiePlot的用法示例。


在下文中一共展示了PiePlot.setLabelOutlineStroke方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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;

}
 
开发者ID:jfree,项目名称:jfree-fxdemos,代码行数:55,代码来源:PieChartFXDemo1.java

示例2: 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;

    }
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:60,代码来源:PieChartDemo1.java

示例3: 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;

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:60,代码来源:PieChartFXDemo1.java

示例4: 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;

}
 
开发者ID:hongliangpan,项目名称:manydesigns.cn,代码行数:58,代码来源:PieChartDemo1.java

示例5: 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;

  }
 
开发者ID:DiegoArranzGarcia,项目名称:JavaTracer,代码行数:48,代码来源:ProfilerView.java

示例6: 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;

}
 
开发者ID:DiegoArranzGarcia,项目名称:JavaTracer,代码行数:48,代码来源:ProfilerViewWithoutSplit.java


注:本文中的org.jfree.chart.plot.PiePlot.setLabelOutlineStroke方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。