本文整理汇总了Java中org.jfree.chart.renderer.category.StatisticalBarRenderer类的典型用法代码示例。如果您正苦于以下问题:Java StatisticalBarRenderer类的具体用法?Java StatisticalBarRenderer怎么用?Java StatisticalBarRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StatisticalBarRenderer类属于org.jfree.chart.renderer.category包,在下文中一共展示了StatisticalBarRenderer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDrawWithNullInfo
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
/**
* Draws the chart with a <code>null</code> info object to make sure that
* no exceptions are thrown (particularly by code in the renderer).
*/
public void testDrawWithNullInfo() {
boolean success = false;
try {
DefaultStatisticalCategoryDataset dataset
= new DefaultStatisticalCategoryDataset();
dataset.add(1.0, 2.0, "S1", "C1");
dataset.add(3.0, 4.0, "S1", "C2");
CategoryPlot plot = new CategoryPlot(dataset,
new CategoryAxis("Category"), new NumberAxis("Value"),
new StatisticalBarRenderer());
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */ chart.createBufferedImage(300, 200,
null);
success = true;
}
catch (NullPointerException e) {
e.printStackTrace();
success = false;
}
assertTrue(success);
}
示例2: createLegend
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
protected JFreeChart createLegend(CategoryDataset dataset) {
// JFreeChart chart = ChartFactory.createAreaChart(
JFreeChart chart = ChartFactory.createLineChart(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // 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();
StatisticalBarRenderer renderer = new StatisticalBarRenderer();
renderer.setErrorIndicatorPaint(Color.black);
renderer.setLegendItemLabelGenerator(new SOCRCategoryCellLabelGenerator(dataset, values_storage, SERIES_COUNT, CATEGORY_COUNT));
plot.setRenderer(renderer);
return chart;
}
示例3: testEquals
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
/**
* Check that the equals() method distinguishes all fields.
*/
public void testEquals() {
StatisticalBarRenderer r1 = new StatisticalBarRenderer();
StatisticalBarRenderer r2 = new StatisticalBarRenderer();
assertEquals(r1, r2);
r1.setErrorIndicatorPaint(Color.red);
assertFalse(r1.equals(r2));
r2.setErrorIndicatorPaint(Color.red);
assertTrue(r2.equals(r1));
r1.setErrorIndicatorStroke(new BasicStroke(1.5f));
assertFalse(r1.equals(r2));
r2.setErrorIndicatorStroke(new BasicStroke(1.5f));
assertTrue(r2.equals(r1));
}
示例4: testDrawWithNullInfo
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
/**
* Draws the chart with a <code>null</code> info object to make sure that
* no exceptions are thrown (particularly by code in the renderer).
*/
public void testDrawWithNullInfo() {
boolean success = false;
try {
DefaultStatisticalCategoryDataset dataset
= new DefaultStatisticalCategoryDataset();
dataset.add(1.0, 2.0, "S1", "C1");
dataset.add(3.0, 4.0, "S1", "C2");
CategoryPlot plot = new CategoryPlot(dataset,
new CategoryAxis("Category"), new NumberAxis("Value"),
new StatisticalBarRenderer());
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */ chart.createBufferedImage(300, 200,
null);
success = true;
}
catch (NullPointerException e) {
e.printStackTrace();
success = false;
}
assertTrue(success);
}
示例5: testDrawWithNullMeanVertical
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
/**
* Draws the chart with a <code>null</code> mean value to make sure that
* no exceptions are thrown (particularly by code in the renderer). See
* bug report 1779941.
*/
public void testDrawWithNullMeanVertical() {
boolean success = false;
try {
DefaultStatisticalCategoryDataset dataset
= new DefaultStatisticalCategoryDataset();
dataset.add(1.0, 2.0, "S1", "C1");
dataset.add(null, new Double(4.0), "S1", "C2");
CategoryPlot plot = new CategoryPlot(dataset,
new CategoryAxis("Category"), new NumberAxis("Value"),
new StatisticalBarRenderer());
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */ chart.createBufferedImage(300, 200,
null);
success = true;
}
catch (NullPointerException e) {
e.printStackTrace();
success = false;
}
assertTrue(success);
}
示例6: testDrawWithNullMeanHorizontal
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
/**
* Draws the chart with a <code>null</code> mean value to make sure that
* no exceptions are thrown (particularly by code in the renderer). See
* bug report 1779941.
*/
public void testDrawWithNullMeanHorizontal() {
boolean success = false;
try {
DefaultStatisticalCategoryDataset dataset
= new DefaultStatisticalCategoryDataset();
dataset.add(1.0, 2.0, "S1", "C1");
dataset.add(null, new Double(4.0), "S1", "C2");
CategoryPlot plot = new CategoryPlot(dataset,
new CategoryAxis("Category"), new NumberAxis("Value"),
new StatisticalBarRenderer());
plot.setOrientation(PlotOrientation.HORIZONTAL);
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */ chart.createBufferedImage(300, 200,
null);
success = true;
}
catch (NullPointerException e) {
e.printStackTrace();
success = false;
}
assertTrue(success);
}
示例7: testDrawWithNullDeviationVertical
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
/**
* Draws the chart with a <code>null</code> standard deviation to make sure
* that no exceptions are thrown (particularly by code in the renderer).
* See bug report 1779941.
*/
public void testDrawWithNullDeviationVertical() {
boolean success = false;
try {
DefaultStatisticalCategoryDataset dataset
= new DefaultStatisticalCategoryDataset();
dataset.add(1.0, 2.0, "S1", "C1");
dataset.add(new Double(4.0), null, "S1", "C2");
CategoryPlot plot = new CategoryPlot(dataset,
new CategoryAxis("Category"), new NumberAxis("Value"),
new StatisticalBarRenderer());
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */ chart.createBufferedImage(300, 200,
null);
success = true;
}
catch (NullPointerException e) {
e.printStackTrace();
success = false;
}
assertTrue(success);
}
示例8: testDrawWithNullDeviationHorizontal
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
/**
* Draws the chart with a <code>null</code> standard deviation to make sure
* that no exceptions are thrown (particularly by code in the renderer).
* See bug report 1779941.
*/
public void testDrawWithNullDeviationHorizontal() {
boolean success = false;
try {
DefaultStatisticalCategoryDataset dataset
= new DefaultStatisticalCategoryDataset();
dataset.add(1.0, 2.0, "S1", "C1");
dataset.add(new Double(4.0), null, "S1", "C2");
CategoryPlot plot = new CategoryPlot(dataset,
new CategoryAxis("Category"), new NumberAxis("Value"),
new StatisticalBarRenderer());
plot.setOrientation(PlotOrientation.HORIZONTAL);
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */ chart.createBufferedImage(300, 200,
null);
success = true;
}
catch (NullPointerException e) {
e.printStackTrace();
success = false;
}
assertTrue(success);
}
示例9: getChart
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
@Override
public JFreeChart getChart() throws IOException {
final JFreeChart chart = ChartFactory.createLineChart("Time to reach uniform state", "Application State", "Time to reach state (s)", getDataset(), PlotOrientation.VERTICAL, false, false, false);
final CategoryPlot category_plot = chart.getCategoryPlot();
category_plot.setRenderer(new StatisticalBarRenderer());
category_plot.getRangeAxis().setLowerBound(0);
PlainChartTheme.applyTheme(chart);
return chart;
}
示例10: getChart
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
@Override
public JFreeChart getChart() throws IOException {
final DefaultStatisticalCategoryDataset dataset = getDataset();
final JFreeChart chart = ChartFactory.createLineChart(getName(), x_axis_label, "Time to reach " + name + " (s)", dataset, PlotOrientation.VERTICAL, showLegend, false, false);
final StatisticalBarRenderer renderer = new StatisticalBarRenderer();
final CategoryPlot category_plot = chart.getCategoryPlot();
category_plot.setRenderer(renderer);
final ValueAxis range_axis = category_plot.getRangeAxis();
range_axis.setLowerBound(0);
PlainChartTheme.applyTheme(chart);
return chart;
}
示例11: getChart
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
@Override
public JFreeChart getChart() throws IOException {
final DefaultStatisticalCategoryDataset dataset = getDataset();
final JFreeChart chart = ChartFactory.createLineChart(getName(), x_axis_label, y_axis_label, dataset, PlotOrientation.VERTICAL, getDataset().getRowCount() > 1, false, false);
final StatisticalBarRenderer renderer = new StatisticalBarRenderer();
final CategoryPlot category_plot = chart.getCategoryPlot();
category_plot.setRenderer(renderer);
final ValueAxis range_axis = category_plot.getRangeAxis();
range_axis.setLowerBound(0);
PlainChartTheme.applyTheme(chart);
return chart;
}
示例12: testHashcode
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
/**
* Two objects that are equal are required to return the same hashCode.
*/
public void testHashcode() {
StatisticalBarRenderer r1 = new StatisticalBarRenderer();
StatisticalBarRenderer r2 = new StatisticalBarRenderer();
assertTrue(r1.equals(r2));
int h1 = r1.hashCode();
int h2 = r2.hashCode();
assertEquals(h1, h2);
}
示例13: testEquals
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
/**
* Check that the equals() method distinguishes all fields.
*/
public void testEquals() {
StatisticalBarRenderer r1 = new StatisticalBarRenderer();
StatisticalBarRenderer r2 = new StatisticalBarRenderer();
assertEquals(r1, r2);
r1.setErrorIndicatorPaint(Color.red);
assertFalse(r1.equals(r2));
r2.setErrorIndicatorPaint(Color.red);
assertTrue(r2.equals(r1));
}
示例14: applyToCategoryItemRenderer
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
/**
* Applies the settings of this theme to the specified renderer.
*
* @param renderer the renderer ({@code null} not permitted).
*/
protected void applyToCategoryItemRenderer(CategoryItemRenderer renderer) {
Args.nullNotPermitted(renderer, "renderer");
if (renderer instanceof AbstractRenderer) {
applyToAbstractRenderer((AbstractRenderer) renderer);
}
renderer.setDefaultItemLabelFont(this.regularFont);
renderer.setDefaultItemLabelPaint(this.itemLabelPaint);
// now we handle some special cases - yes, UGLY code alert!
// BarRenderer
if (renderer instanceof BarRenderer) {
BarRenderer br = (BarRenderer) renderer;
br.setBarPainter(this.barPainter);
br.setShadowVisible(this.shadowVisible);
br.setShadowPaint(this.shadowPaint);
}
// StatisticalBarRenderer
if (renderer instanceof StatisticalBarRenderer) {
StatisticalBarRenderer sbr = (StatisticalBarRenderer) renderer;
sbr.setErrorIndicatorPaint(this.errorIndicatorPaint);
}
// MinMaxCategoryRenderer
if (renderer instanceof MinMaxCategoryRenderer) {
MinMaxCategoryRenderer mmcr = (MinMaxCategoryRenderer) renderer;
mmcr.setGroupPaint(this.errorIndicatorPaint);
}
}
示例15: createLegend
import org.jfree.chart.renderer.category.StatisticalBarRenderer; //导入依赖的package包/类
protected JFreeChart createLegend(CategoryDataset dataset) {
// JFreeChart chart = ChartFactory.createAreaChart(
JFreeChart chart = ChartFactory.createLineChart(
chartTitle, // chart title
domainLabel, // domain axis label
rangeLabel, // 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();
StatisticalBarRenderer renderer = new StatisticalBarRenderer();
renderer.setErrorIndicatorPaint(Color.black);
// renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
plot.setRenderer(renderer);
// renderer.setDrawOutlines(true);
// renderer.setUseFillPaint(true);
// renderer.setFillPaint(Color.white);
return chart;
}