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


Java StackedBarRenderer类代码示例

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


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

示例1: enableFlatLook

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
public static void enableFlatLook(final boolean flat) {
	if (flat) {
		BarRenderer.setDefaultBarPainter(new StandardBarPainter());
		BarRenderer.setDefaultShadowsVisible(false);
		XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter());
		XYBarRenderer.setDefaultShadowsVisible(false);
		StackedBarRenderer.setDefaultBarPainter(new StandardBarPainter());
		StackedBarRenderer.setDefaultShadowsVisible(false);
	} else {
		BarRenderer.setDefaultBarPainter(new GradientBarPainter());
		BarRenderer.setDefaultShadowsVisible(true);
		XYBarRenderer.setDefaultBarPainter(new GradientXYBarPainter());
		XYBarRenderer.setDefaultShadowsVisible(true);
		StackedBarRenderer.setDefaultBarPainter(new GradientBarPainter());
		StackedBarRenderer.setDefaultShadowsVisible(true);
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:18,代码来源:ChartJFreeChartOutputHistogram.java

示例2: testFindRangeBounds

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
/**
 * Some checks for the findRangeBounds() method.
 */
public void testFindRangeBounds() {
    StackedBarRenderer r = new StackedBarRenderer();
    assertNull(r.findRangeBounds(null));

    // an empty dataset should return a null range
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    assertNull(r.findRangeBounds(dataset));

    dataset.addValue(1.0, "R1", "C1");
    assertEquals(new Range(0.0, 1.0), r.findRangeBounds(dataset));

    dataset.addValue(-2.0, "R1", "C2");
    assertEquals(new Range(-2.0, 1.0), r.findRangeBounds(dataset));

    dataset.addValue(null, "R1", "C3");
    assertEquals(new Range(-2.0, 1.0), r.findRangeBounds(dataset));

    dataset.addValue(2.0, "R2", "C1");
    assertEquals(new Range(-2.0, 3.0), r.findRangeBounds(dataset));

    dataset.addValue(null, "R2", "C2");
    assertEquals(new Range(-2.0, 3.0), r.findRangeBounds(dataset));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:27,代码来源:StackedBarRendererTests.java

示例3: createStackedBarChart

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
/**
 * Creates a stacked bar chart with default settings.  The chart object
 * returned by this method uses a {@link CategoryPlot} instance as the
 * plot, with a {@link CategoryAxis} for the domain axis, a
 * {@link NumberAxis} as the range axis, and a {@link StackedBarRenderer}
 * as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param domainAxisLabel  the label for the category axis
 *                         (<code>null</code> permitted).
 * @param rangeAxisLabel  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 stacked bar chart.
 */
public static JFreeChart createStackedBarChart(String title,
        String domainAxisLabel, String rangeAxisLabel,
        CategoryDataset dataset, boolean legend) {

    CategoryAxis categoryAxis = new CategoryAxis(domainAxisLabel);
    ValueAxis valueAxis = new NumberAxis(rangeAxisLabel);
    StackedBarRenderer renderer = new StackedBarRenderer();
    renderer.setBaseToolTipGenerator(
                new StandardCategoryToolTipGenerator());
    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

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

示例4: setStackBarRender

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
public static void setStackBarRender(CategoryPlot plot) {
    plot.setNoDataMessage(NO_DATA_MSG);
    plot.setInsets(new RectangleInsets(10, 10, 5, 10));
    StackedBarRenderer renderer = (StackedBarRenderer) plot.getRenderer();
    renderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
    plot.setRenderer(renderer);
    setXAixs(plot);
    setYAixs(plot);
}
 
开发者ID:Fanping,项目名称:iveely.ml,代码行数:10,代码来源:ChartUtils.java

示例5: createStackedBarChart

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
/**
 * Creates a stacked bar chart with default settings.
 * <P>
 * The chart object returned by this method uses a {@link CategoryPlot} instance as the
 * plot, with a {@link CategoryAxis} for the domain axis, a {@link NumberAxis} as the
 * range axis, and a {@link StackedBarRenderer} as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param domainAxisLabel  the label for the category axis (<code>null</code> permitted).
 * @param rangeAxisLabel  the label for the value axis (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the orientation of the chart (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 stacked bar chart.
 */
public static JFreeChart createStackedBarChart(String title,
                                               String domainAxisLabel,
                                               String rangeAxisLabel,
                                               CategoryDataset dataset,
                                               PlotOrientation orientation,
                                               boolean legend,
                                               boolean tooltips,
                                               boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }

    CategoryAxis categoryAxis = new CategoryAxis(domainAxisLabel);
    ValueAxis valueAxis = new NumberAxis(rangeAxisLabel);

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

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);

    return chart;

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

示例6: testHashcode

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

示例7: testEquals

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    StackedBarRenderer r1 = new StackedBarRenderer();
    StackedBarRenderer r2 = new StackedBarRenderer();
    assertTrue(r1.equals(r2));
    assertTrue(r2.equals(r1));
    
    r1.setRenderAsPercentages(true);
    assertFalse(r1.equals(r2));
    r2.setRenderAsPercentages(true);
    assertTrue(r1.equals(r2));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:15,代码来源:StackedBarRendererTests.java

示例8: testHashCode

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

示例9: createStackedBarChart

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
/**
 * Creates a stacked bar chart with default settings.  The chart object 
 * returned by this method uses a {@link CategoryPlot} instance as the
 * plot, with a {@link CategoryAxis} for the domain axis, a 
 * {@link NumberAxis} as the range axis, and a {@link StackedBarRenderer} 
 * as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param domainAxisLabel  the label for the category axis 
 *                         (<code>null</code> permitted).
 * @param rangeAxisLabel  the label for the value axis 
 *                        (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the orientation of the chart (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 stacked bar chart.
 */
public static JFreeChart createStackedBarChart(String title,
                                               String domainAxisLabel,
                                               String rangeAxisLabel,
                                               CategoryDataset dataset,
                                               PlotOrientation orientation,
                                               boolean legend,
                                               boolean tooltips,
                                               boolean urls) {

    if (orientation == null) {
        throw new IllegalArgumentException("Null 'orientation' argument.");
    }

    CategoryAxis categoryAxis = new CategoryAxis(domainAxisLabel);
    ValueAxis valueAxis = new NumberAxis(rangeAxisLabel);

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

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, 
            renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);

    return chart;

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

示例10: makePlot

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
@Override
protected Plot makePlot(final JFreeChartBuilder.PlotParameters parameters) {

    final DefaultKeyedValues2DDataset tmpDataset = this.getDataset();

    final CategoryAxis tmpCategoryAxis = this.makeCategoryAxis(domain);

    final ValueAxis tmpValueAxis = this.makeValueAxis(range);

    final StackedBarRenderer tmpRenderer = new StackedBarRenderer();
    tmpRenderer.setBarPainter(new StandardBarPainter());
    tmpRenderer.setShadowVisible(false);

    if (this.isTooltips()) {
        tmpRenderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    }
    if (this.isUrls()) {
        tmpRenderer.setBaseItemURLGenerator(new StandardCategoryURLGenerator());
    }

    this.setColours(tmpRenderer, tmpDataset);

    final CategoryPlot retVal = new CategoryPlot(tmpDataset, tmpCategoryAxis, tmpValueAxis, tmpRenderer);
    retVal.setOrientation(parameters.getOrientation());
    retVal.setBackgroundPaint(parameters.getBackground());
    retVal.setOutlinePaint(parameters.getOutline());

    return retVal;
}
 
开发者ID:optimatika,项目名称:ojAlgo-extensions,代码行数:30,代码来源:StackedBarChartBuilder.java

示例11: createStackedBarChart

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
/**
 * Creates a stacked bar chart with default settings.  The chart object
 * returned by this method uses a {@link CategoryPlot} instance as the
 * plot, with a {@link CategoryAxis} for the domain axis, a
 * {@link NumberAxis} as the range axis, and a {@link StackedBarRenderer}
 * as the renderer.
 *
 * @param title  the chart title (<code>null</code> permitted).
 * @param domainAxisLabel  the label for the category axis
 *                         (<code>null</code> permitted).
 * @param rangeAxisLabel  the label for the value axis
 *                        (<code>null</code> permitted).
 * @param dataset  the dataset for the chart (<code>null</code> permitted).
 * @param orientation  the orientation of the chart (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 stacked bar chart.
 */
public static JFreeChart createStackedBarChart(String title,
        String domainAxisLabel, String rangeAxisLabel,
        CategoryDataset dataset, PlotOrientation orientation,
        boolean legend, boolean tooltips, boolean urls) {

    ParamChecks.nullNotPermitted(orientation, "orientation");

    CategoryAxis categoryAxis = new CategoryAxis(domainAxisLabel);
    ValueAxis valueAxis = new NumberAxis(rangeAxisLabel);

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

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

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

示例12: createStackedBarChart

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
/**
 * Creates a stacked bar chart with default settings.  The chart object
 * returned by this method uses a {@link CategoryPlot} instance as the
 * plot, with a {@link CategoryAxis} for the domain axis, a
 * {@link NumberAxis} as the range axis, and a {@link StackedBarRenderer}
 * as the renderer.
 *
 * @param title  the chart title ({@code null} permitted).
 * @param domainAxisLabel  the label for the category axis
 *                         ({@code null} permitted).
 * @param rangeAxisLabel  the label for the value axis
 *                        ({@code null} permitted).
 * @param dataset  the dataset for the chart ({@code null} permitted).
 * @param orientation  the orientation of the chart (horizontal or
 *                     vertical) ({@code null} 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 stacked bar chart.
 */
public static JFreeChart createStackedBarChart(String title,
        String domainAxisLabel, String rangeAxisLabel,
        CategoryDataset dataset, PlotOrientation orientation,
        boolean legend, boolean tooltips, boolean urls) {

    Args.nullNotPermitted(orientation, "orientation");

    CategoryAxis categoryAxis = new CategoryAxis(domainAxisLabel);
    ValueAxis valueAxis = new NumberAxis(rangeAxisLabel);

    StackedBarRenderer renderer = new StackedBarRenderer();
    if (tooltips) {
        renderer.setDefaultToolTipGenerator(
                new StandardCategoryToolTipGenerator());
    }
    if (urls) {
        renderer.setDefaultItemURLGenerator(
                new StandardCategoryURLGenerator());
    }

    CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
            renderer);
    plot.setOrientation(orientation);
    JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
            plot, legend);
    currentTheme.apply(chart);
    return chart;

}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:51,代码来源:ChartFactory.java

示例13: StackedBarRendererBuilder

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
/**
 * Creates a new instance of StackedBarRendererBuilder
 */
public StackedBarRendererBuilder() {
    try {
        setBeanClass(StackedBarRenderer.class);
    } catch (IntrospectionException ex) {
        logger.log(Level.WARNING, ex.getMessage(), ex);
    }         
}
 
开发者ID:davetcc,项目名称:groovychart,代码行数:11,代码来源:StackedBarRendererBuilder.java

示例14: processNode

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
public void processNode(Object name, Map map, Object value) throws Exception {
    String method = name.toString();
    if(value != null && value instanceof StackedBarRenderer) {
        this.renderer = (StackedBarRenderer)value;
    }else if(method.equalsIgnoreCase("StackedBarRenderer")) {
        this.setProperties(this.renderer, map);
    }        
}
 
开发者ID:davetcc,项目名称:groovychart,代码行数:9,代码来源:StackedBarRendererBuilder.java

示例15: reconfigureColorEncoding

import org.jfree.chart.renderer.category.StackedBarRenderer; //导入依赖的package包/类
private void reconfigureColorEncoding() {
    StackedBarRenderer renderer = new StackedBarRenderer();
    renderer.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL));

    renderer.setItemMargin(0.0);

    int barIndex = 0;

    //blue
    Paint p1 = new GradientPaint(0.0f, 0.0f, new Color(0x22, 0x22, 0xFF), 0.0f, 0.0f, new Color(0x88, 0x88, 0xFF));
    renderer.setSeriesPaint(barIndex, p1);
    renderer.setSeriesToolTipGenerator(barIndex, new StandardCategoryToolTipGenerator());

    //green
    barIndex++;
    Paint p3 = new GradientPaint(0.0f, 0.0f, new Color(0x22, 0xFF, 0x22), 0.0f, 0.0f, new Color(0x88, 0xFF, 0x88));
    renderer.setSeriesPaint(barIndex, p3);
    renderer.setSeriesToolTipGenerator(barIndex, new StandardCategoryToolTipGenerator());

    if (hightlightItem != null) {
        //red
        barIndex++;
        Paint p2 = new GradientPaint(0.0f, 0.0f, new Color(0xFF, 0x22, 0x22), 0.0f, 0.0f, new Color(0xFF, 0x88, 0x88));
        renderer.setSeriesPaint(barIndex, p2);
        renderer.setSeriesToolTipGenerator(barIndex, new StandardCategoryToolTipGenerator());
    }

    plot.setRenderer(renderer);
}
 
开发者ID:holgerbrandl,项目名称:opencards,代码行数:30,代码来源:LeitnerStatePanel.java


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