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


Java BarRenderer3D类代码示例

本文整理汇总了Java中org.jfree.chart.renderer.category.BarRenderer3D的典型用法代码示例。如果您正苦于以下问题:Java BarRenderer3D类的具体用法?Java BarRenderer3D怎么用?Java BarRenderer3D使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BarRenderer3D类属于org.jfree.chart.renderer.category包,在下文中一共展示了BarRenderer3D类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createBar3DChart

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
@Override
protected JFreeChart createBar3DChart() throws JRException
{
	JFreeChart jfreeChart = super.createBar3DChart();
	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	BarRenderer3D barRenderer3D = (BarRenderer3D)categoryPlot.getRenderer();

	barRenderer3D = new GradientBarRenderer3D(barRenderer3D);
	categoryPlot.setRenderer(barRenderer3D);

	barRenderer3D.setItemMargin(0);
	barRenderer3D.setWallPaint(ChartThemesConstants.TRANSPARENT_PAINT);
	//categoryPlot.setOrientation(PlotOrientation.HORIZONTAL);

	barRenderer3D.setItemMargin(0);

	CategoryDataset categoryDataset = categoryPlot.getDataset();
	if (categoryDataset != null)
	{
		for (int i = 0; i < categoryDataset.getRowCount(); i++)
		{
			barRenderer3D.setSeriesPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
		}
	}
	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:27,代码来源:EyeCandySixtiesChartTheme.java

示例2: createBar3DChart

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
@Override
protected JFreeChart createBar3DChart() throws JRException
{
	JFreeChart jfreeChart = super.createBar3DChart();
	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	BarRenderer3D barRenderer3D = (BarRenderer3D)categoryPlot.getRenderer();
	barRenderer3D.setItemMargin(0);
	barRenderer3D.setWallPaint(ChartThemesConstants.TRANSPARENT_PAINT);
	//categoryPlot.setOrientation(PlotOrientation.HORIZONTAL);
	CategoryDataset categoryDataset = categoryPlot.getDataset();
	if(categoryDataset != null)
	{
		for(int i = 0; i < categoryDataset.getRowCount(); i++)
		{
			barRenderer3D.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);
		}
	}
	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:20,代码来源:AegeanChartTheme.java

示例3: createStackedBar3DChart

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
@Override
protected JFreeChart createStackedBar3DChart() throws JRException
{
	JFreeChart jfreeChart = super.createStackedBar3DChart();
	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	BarRenderer3D barRenderer3D = (BarRenderer3D)categoryPlot.getRenderer();
	barRenderer3D.setWallPaint(ChartThemesConstants.TRANSPARENT_PAINT);
	barRenderer3D.setItemMargin(0);
	CategoryDataset categoryDataset = categoryPlot.getDataset();
	if(categoryDataset != null)
	{
		for(int i = 0; i < categoryDataset.getRowCount(); i++)
		{
			barRenderer3D.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);
		}
	}
	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:19,代码来源:AegeanChartTheme.java

示例4: createLegend

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
protected JFreeChart createLegend(CategoryDataset dataset) {
      
//  JFreeChart chart = ChartFactory.createAreaChart(
       JFreeChart chart = ChartFactory.createBarChart3D(
           chartTitle,             // chart title
           "Category",               // domain axis label
           "Value",                  // range axis label
           dataset,                  // data
           PlotOrientation.VERTICAL, // orientation
           true,                     // include legend
           true,                     // tooltips
           false                     // urls
       );

       // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
       chart.setBackgroundPaint(Color.white);
       CategoryPlot plot = chart.getCategoryPlot();

       BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer();
      // renderer.setDrawOutlines(true);
      // renderer.setUseFillPaint(true);
      // renderer.setFillPaint(Color.white);
       renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
       return chart;
       
   }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:27,代码来源:SuperCategoryChart_Bar3D.java

示例5: set3d

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
private void set3d(Plot plot) {
       if(!show3d) return;
       
       plot.setForegroundAlpha(0.6f);
       
       if(plot instanceof CategoryPlot) {
           plot.setForegroundAlpha(0.8f);
       	CategoryPlot cp=(CategoryPlot) plot;
       	CategoryItemRenderer renderer = cp.getRenderer();
       	if(renderer instanceof BarRenderer3D) {
       		BarRenderer3D br3d=(BarRenderer3D) renderer;
       		cp.setRenderer(new BarRenderer3DWrap(br3d,xoffset,yoffset));
       	}
       	
       }
       else if(plot instanceof PiePlot3D) {
       	PiePlot3D pp3d=(PiePlot3D) plot;
           pp3d.setDepthFactor(0.10);    
       }
       
       

       //CategoryItemRenderer renderer = plot.getRenderer();
       
}
 
开发者ID:lucee,项目名称:Lucee4,代码行数:26,代码来源:Chart.java

示例6: createBarChart3D

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
/**
 * Creates a bar chart with a 3D effect. The chart object returned by this
 * method uses a {@link CategoryPlot} instance as the plot, with a
 * {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as
 * the range axis, and a {@link BarRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<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.
 *
 * @return A bar chart with a 3D effect.
 */
public static JFreeChart createBarChart3D(String title,
        String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, boolean legend) {

    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);
    BarRenderer3D renderer = new BarRenderer3D();
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator());
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    plot.setForegroundAlpha(0.75f);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:35,代码来源:ChartFactory.java

示例7: createBarChart

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
private static  JFreeChart createBarChart(String title,String category,String value, CategoryDataset dataset) {   
	    JFreeChart chart = ChartFactory.createBarChart3D(title, // chart title   
	    			category, // domain axis label   
	    			value, // range axis label   
	                dataset, // data   
	                PlotOrientation.VERTICAL, // 图标方向   
	                true, // 是否显示legend   
	                true, // 是否显示tooltips   
	                false // 是否显示URLs   
	        );   
	    CategoryPlot plot = chart.getCategoryPlot();//设置图的高级属性 
	    plot.setBackgroundPaint(ChartColor.WHITE);
	    NumberAxis na= (NumberAxis)plot.getRangeAxis();
//	    na.setAutoTickUnitSelection(false);//设置小数点位数
	    na.setNumberFormatOverride(df);
//	    NumberTickUnit nt=new NumberTickUnit(1.22);
//	    na.setTickUnit(nt);
//	    plot.setRangeAxis(na);
	    BarRenderer3D renderer = new BarRenderer3D();//3D属性修改 
	    renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
	    renderer.setBaseItemLabelsVisible(true);
	    renderer.setItemLabelAnchorOffset(10);
	    renderer.setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BASELINE_CENTER));
		renderer.setSeriesPaint(0,new Color(34,139,34));
		renderer.setSeriesPaint(1,new Color(154,205,50));
		renderer.setSeriesPaint(2,new Color(0,255,0));
		renderer.setSeriesPaint(3,new Color(127,255,212));
	    plot.setRenderer(renderer);//将修改后的属性值保存到图中 
	    return chart;   
	}
 
开发者ID:dbiir,项目名称:ts-benchmark,代码行数:31,代码来源:ChartBizUtil.java

示例8: createBarChart3D

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
/**
 * Creates a bar chart with a 3D effect.
 * <P>
 * The chart object returned by this method uses a {@link CategoryPlot} instance as the
 * plot, with a {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as the
 * range axis, and a {@link BarRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the plot orientation (horizontal or vertical) (<code>null</code>
 *                     not 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 bar chart with a 3D effect.
 */
public static JFreeChart createBarChart3D(String title,
                                          String categoryAxisLabel,
                                          String valueAxisLabel,
                                          CategoryDataset dataset,
                                          PlotOrientation orientation,
                                          boolean legend,
                                          boolean tooltips,
                                          boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    BarRenderer3D renderer = new BarRenderer3D();
    if (tooltips) {
        renderer.setToolTipGenerator(new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setItemURLGenerator(new StandardCategoryURLGenerator());
    }

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    plot.setOrientation(orientation);
    if (orientation == PlotOrientation.HORIZONTAL) {
        // change rendering order to ensure that bar overlapping is the right way around
        plot.setRowRenderingOrder(SortOrder.DESCENDING);
        plot.setColumnRenderingOrder(SortOrder.DESCENDING);
    }
    plot.setForegroundAlpha(0.75f);

    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);

    return chart;

}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:57,代码来源:ChartFactory.java

示例9: testHashcode

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode. 
 */
public void testHashcode() {
    BarRenderer3D r1 = new BarRenderer3D();
    BarRenderer3D r2 = new BarRenderer3D();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:12,代码来源:BarRenderer3DTests.java

示例10: createBarChart3D

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
/**
 * Creates a bar chart with a 3D effect. The chart object returned by this
 * method uses a {@link CategoryPlot} instance as the plot, with a
 * {@link CategoryAxis3D} for the domain axis, a {@link NumberAxis3D} as
 * the range axis, and a {@link BarRenderer3D} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param categoryAxisLabel  the label for the category axis
 *                           (<code>null</code> permitted).
 * @param valueAxisLabel  the label for the value axis (<code>null</code>
 *                        permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the plot orientation (horizontal or vertical)
 *                     (<code>null</code> not 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 bar chart with a 3D effect.
 */
public static JFreeChart createBarChart3D(String title,
        String categoryAxisLabel, String valueAxisLabel,
        CategoryDataset dataset, PlotOrientation orientation,
        boolean legend, boolean tooltips, boolean urls) {

    ParamChecks.nullNotPermitted(orientation, "orientation");
    CategoryAxis categoryAxis = new CategoryAxis3D(categoryAxisLabel);
    ValueAxis valueAxis = new NumberAxis3D(valueAxisLabel);

    BarRenderer3D renderer = new BarRenderer3D();
    if (tooltips) {
        renderer.setBaseToolTipGenerator(
                new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setBaseItemURLGenerator(
                new StandardCategoryURLGenerator());
    }

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    plot.setOrientation(orientation);
    if (orientation == PlotOrientation.HORIZONTAL) {
        // change rendering order to ensure that bar overlapping is the
        // right way around
        plot.setRowRenderingOrder(SortOrder.DESCENDING);
        plot.setColumnRenderingOrder(SortOrder.DESCENDING);
    }
    plot.setForegroundAlpha(0.75f);

    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

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

示例11: StandardChartTheme

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
/**
 * Creates a new default instance.
 *
 * @param name  the name of the theme (<code>null</code> not permitted).
 * @param shadow  a flag that controls whether a shadow generator is 
 *                included.
 *
 * @since 1.0.14
 */
public StandardChartTheme(String name, boolean shadow) {
    ParamChecks.nullNotPermitted(name, "name");
    this.name = name;
    this.extraLargeFont = new Font("Tahoma", Font.BOLD, 20);
    this.largeFont = new Font("Tahoma", Font.BOLD, 14);
    this.regularFont = new Font("Tahoma", Font.PLAIN, 12);
    this.smallFont = new Font("Tahoma", Font.PLAIN, 10);
    this.titlePaint = Color.black;
    this.subtitlePaint = Color.black;
    this.legendBackgroundPaint = Color.white;
    this.legendItemPaint = Color.darkGray;
    this.chartBackgroundPaint = Color.white;
    this.drawingSupplier = new DefaultDrawingSupplier();
    this.plotBackgroundPaint = Color.lightGray;
    this.plotOutlinePaint = Color.black;
    this.labelLinkPaint = Color.black;
    this.labelLinkStyle = PieLabelLinkStyle.CUBIC_CURVE;
    this.axisOffset = new RectangleInsets(4, 4, 4, 4);
    this.domainGridlinePaint = Color.white;
    this.rangeGridlinePaint = Color.white;
    this.baselinePaint = Color.black;
    this.crosshairPaint = Color.blue;
    this.axisLabelPaint = Color.darkGray;
    this.tickLabelPaint = Color.darkGray;
    this.barPainter = new GradientBarPainter();
    this.xyBarPainter = new GradientXYBarPainter();
    this.shadowVisible = false;
    this.shadowPaint = Color.gray;
    this.itemLabelPaint = Color.black;
    this.thermometerPaint = Color.white;
    this.wallPaint = BarRenderer3D.DEFAULT_WALL_PAINT;
    this.errorIndicatorPaint = Color.black;
    this.shadowGenerator = shadow ? new DefaultShadowGenerator() : null;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:44,代码来源:StandardChartTheme.java

示例12: createStackedBar3DChart

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
@Override
protected JFreeChart createStackedBar3DChart() throws JRException
{
	JFreeChart jfreeChart = super.createStackedBar3DChart();
	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	BarRenderer3D barRenderer3D = (BarRenderer3D)categoryPlot.getRenderer();
	barRenderer3D.setWallPaint(ChartThemesConstants.TRANSPARENT_PAINT);

	//CategoryDataset categoryDataset = categoryPlot.getDataset();
	barRenderer3D.setItemMargin(0);
	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:13,代码来源:EyeCandySixtiesChartTheme.java

示例13: createChart

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
/**
   * Creates a chart.
   * 
   * @param dataset  the dataset.
   * 
   * @return The chart.
   */
  protected JFreeChart createChart(CategoryDataset dataset) {
      
      JFreeChart chart = ChartFactory.createBarChart3D(
          chartTitle,       // chart title
          domainLabel,                  // domain axis label
          rangeLabel,                     // range axis label
          dataset,                     // data
          PlotOrientation.HORIZONTAL,  // orientation
          !legendPanelOn,                        // include legend
          true,                        // tooltips
          false                        // urls
      );

      CategoryPlot plot = chart.getCategoryPlot();
      plot.setForegroundAlpha(1.0f);

      // left align the category labels...
      CategoryAxis axis = plot.getDomainAxis();
      CategoryLabelPositions p = axis.getCategoryLabelPositions();
      
      CategoryLabelPosition left = new CategoryLabelPosition(
          RectangleAnchor.LEFT, TextBlockAnchor.CENTER_LEFT, 
          TextAnchor.CENTER_LEFT, 0.0,
          CategoryLabelWidthType.RANGE, 0.30f
      );
      axis.setCategoryLabelPositions(CategoryLabelPositions.replaceLeftPosition(p, left));
      
      BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer();
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
setCategorySummary(dataset);
      return chart;        
  
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:41,代码来源:BarChart3DDemo2.java

示例14: createChart

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
/**
   * Creates a 3D bar chart.
   * 
   * @param dataset  the category dataset.
   * 
   * @return The chart.
   */
  protected JFreeChart createChart(CategoryDataset dataset) {
      
      JFreeChart chart = ChartFactory.createBarChart3D(
          chartTitle,      // chart title
          domainLabel,               // domain axis label
          rangeLabel,                  // range axis label
          dataset,                  // data
          PlotOrientation.VERTICAL, // orientation
          !legendPanelOn,                     // include legend
          true,                     // tooltips
          false                     // urls
      );

      CategoryPlot plot = chart.getCategoryPlot();
      plot.setDomainGridlinesVisible(true);
      CategoryAxis axis = plot.getDomainAxis();
      axis.setCategoryLabelPositions(
              CategoryLabelPositions.createUpRotationLabelPositions(
                      Math.PI / 8.0));
      BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer();
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
      renderer.setDrawBarOutline(false);

setCategorySummary(dataset);
      return chart;

  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:35,代码来源:BarChart3DDemo1.java

示例15: StandardChartTheme

import org.jfree.chart.renderer.category.BarRenderer3D; //导入依赖的package包/类
/**
 * Creates a new default instance.
 *
 * @param name  the name of the theme (<code>null</code> not permitted).
 */
public StandardChartTheme(String name) {
    if (name == null) {
        throw new IllegalArgumentException("Null 'name' argument.");
    }
    this.name = name;
    this.extraLargeFont = new Font("Tahoma", Font.BOLD, 20);
    this.largeFont = new Font("Tahoma", Font.BOLD, 14);
    this.regularFont = new Font("Tahoma", Font.PLAIN, 12);
    this.smallFont = new Font("Tahoma", Font.PLAIN, 10);
    this.titlePaint = Color.black;
    this.subtitlePaint = Color.black;
    this.legendBackgroundPaint = Color.white;
    this.legendItemPaint = Color.darkGray;
    this.chartBackgroundPaint = Color.white;
    this.drawingSupplier = new DefaultDrawingSupplier();
    this.plotBackgroundPaint = Color.lightGray;
    this.plotOutlinePaint = Color.black;
    this.labelLinkPaint = Color.black;
    this.labelLinkStyle = PieLabelLinkStyle.CUBIC_CURVE;
    this.axisOffset = new RectangleInsets(4, 4, 4, 4);
    this.domainGridlinePaint = Color.white;
    this.rangeGridlinePaint = Color.white;
    this.crosshairPaint = Color.blue;
    this.axisLabelPaint = Color.darkGray;
    this.tickLabelPaint = Color.darkGray;
    this.barPainter = new GradientBarPainter();
    this.xyBarPainter = new GradientXYBarPainter();
    this.shadowVisible = true;
    this.shadowPaint = Color.gray;
    this.itemLabelPaint = Color.black;
    this.thermometerPaint = Color.white;
    this.wallPaint = BarRenderer3D.DEFAULT_WALL_PAINT;
    this.errorIndicatorPaint = Color.black;
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:40,代码来源:StandardChartTheme.java


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