本文整理汇总了Java中org.jfree.chart.renderer.xy.XYStepAreaRenderer类的典型用法代码示例。如果您正苦于以下问题:Java XYStepAreaRenderer类的具体用法?Java XYStepAreaRenderer怎么用?Java XYStepAreaRenderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XYStepAreaRenderer类属于org.jfree.chart.renderer.xy包,在下文中一共展示了XYStepAreaRenderer类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createXYStepAreaChart
import org.jfree.chart.renderer.xy.XYStepAreaRenderer; //导入依赖的package包/类
/**
* Creates a filled stepped XY plot with default settings.
*
* @param title the chart title (<code>null</code> permitted).
* @param xAxisLabel a label for the X-axis (<code>null</code> permitted).
* @param yAxisLabel a label for the Y-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 chart.
*/
public static JFreeChart createXYStepAreaChart(String title,
String xAxisLabel, String yAxisLabel, XYDataset dataset,
boolean legend) {
NumberAxis xAxis = new NumberAxis(xAxisLabel);
xAxis.setAutoRangeIncludesZero(false);
NumberAxis yAxis = new NumberAxis(yAxisLabel);
XYItemRenderer renderer = new XYStepAreaRenderer(
XYStepAreaRenderer.AREA_AND_SHAPES);
renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
XYPlot plot = new XYPlot(dataset, xAxis, yAxis, null);
plot.setRenderer(renderer);
plot.setDomainCrosshairVisible(false);
plot.setRangeCrosshairVisible(false);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例2: testHashcode
import org.jfree.chart.renderer.xy.XYStepAreaRenderer; //导入依赖的package包/类
/**
* Two objects that are equal are required to return the same hashCode.
*/
public void testHashcode() {
XYStepAreaRenderer r1 = new XYStepAreaRenderer();
XYStepAreaRenderer r2 = new XYStepAreaRenderer();
assertTrue(r1.equals(r2));
int h1 = r1.hashCode();
int h2 = r2.hashCode();
assertEquals(h1, h2);
}
示例3: testEquals
import org.jfree.chart.renderer.xy.XYStepAreaRenderer; //导入依赖的package包/类
/**
* Check that the equals() method distinguishes all fields.
*/
public void testEquals() {
XYStepAreaRenderer r1 = new XYStepAreaRenderer();
XYStepAreaRenderer r2 = new XYStepAreaRenderer();
assertEquals(r1, r2);
r1.setOutline(true);
assertFalse(r1.equals(r2));
r2.setOutline(true);
assertTrue(r1.equals(r2));
r1.setShapesVisible(true);
assertFalse(r1.equals(r2));
r2.setShapesVisible(true);
assertTrue(r1.equals(r2));
r1.setShapesFilled(true);
assertFalse(r1.equals(r2));
r2.setShapesFilled(true);
assertTrue(r1.equals(r2));
r1.setPlotArea(false);
assertFalse(r1.equals(r2));
r2.setPlotArea(false);
assertTrue(r1.equals(r2));
r1.setRangeBase(-1.0);
assertFalse(r1.equals(r2));
r2.setRangeBase(-1.0);
assertTrue(r1.equals(r2));
}
示例4: testDrawWithNullInfo
import org.jfree.chart.renderer.xy.XYStepAreaRenderer; //导入依赖的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 {
DefaultTableXYDataset dataset = new DefaultTableXYDataset();
XYSeries s1 = new XYSeries("Series 1", true, false);
s1.add(5.0, 5.0);
s1.add(10.0, 15.5);
s1.add(15.0, 9.5);
s1.add(20.0, 7.5);
dataset.addSeries(s1);
XYSeries s2 = new XYSeries("Series 2", true, false);
s2.add(5.0, 5.0);
s2.add(10.0, 15.5);
s2.add(15.0, 9.5);
s2.add(20.0, 3.5);
dataset.addSeries(s2);
XYPlot plot = new XYPlot(dataset,
new NumberAxis("X"), new NumberAxis("Y"),
new XYStepAreaRenderer());
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */ chart.createBufferedImage(300, 200,
null);
success = true;
}
catch (NullPointerException e) {
e.printStackTrace();
success = false;
}
assertTrue(success);
}
示例5: testEquals
import org.jfree.chart.renderer.xy.XYStepAreaRenderer; //导入依赖的package包/类
/**
* Check that the equals() method distinguishes all fields.
*/
public void testEquals() {
XYStepAreaRenderer r1 = new XYStepAreaRenderer();
XYStepAreaRenderer r2 = new XYStepAreaRenderer();
assertEquals(r1, r2);
r1.setOutline(true);
assertFalse(r1.equals(r2));
r2.setOutline(true);
assertTrue(r1.equals(r2));
r1.setShapesVisible(true);
assertFalse(r1.equals(r2));
r2.setShapesVisible(true);
assertTrue(r1.equals(r2));
r1.setShapesFilled(true);
assertFalse(r1.equals(r2));
r2.setShapesFilled(true);
assertTrue(r1.equals(r2));
r1.setPlotArea(false);
assertFalse(r1.equals(r2));
r2.setPlotArea(false);
assertTrue(r1.equals(r2));
r1.setRangeBase(-1.0);
assertFalse(r1.equals(r2));
r2.setRangeBase(-1.0);
assertTrue(r1.equals(r2));
}
示例6: testHashcode
import org.jfree.chart.renderer.xy.XYStepAreaRenderer; //导入依赖的package包/类
/**
* Two objects that are equal are required to return the same hashCode.
*/
public void testHashcode() {
XYStepAreaRenderer r1 = new XYStepAreaRenderer();
XYStepAreaRenderer r2 = new XYStepAreaRenderer();
assertTrue(r1.equals(r2));
int h1 = r1.hashCode();
int h2 = r2.hashCode();
assertEquals(h1, h2);
}
示例7: testDrawWithNullInfo
import org.jfree.chart.renderer.xy.XYStepAreaRenderer; //导入依赖的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 {
DefaultTableXYDataset dataset = new DefaultTableXYDataset();
XYSeries s1 = new XYSeries("Series 1", true, false);
s1.add(5.0, 5.0);
s1.add(10.0, 15.5);
s1.add(15.0, 9.5);
s1.add(20.0, 7.5);
dataset.addSeries(s1);
XYSeries s2 = new XYSeries("Series 2", true, false);
s2.add(5.0, 5.0);
s2.add(10.0, 15.5);
s2.add(15.0, 9.5);
s2.add(20.0, 3.5);
dataset.addSeries(s2);
XYPlot plot = new XYPlot(dataset,
new NumberAxis("X"), new NumberAxis("Y"),
new XYStepAreaRenderer());
JFreeChart chart = new JFreeChart(plot);
/* BufferedImage image = */ chart.createBufferedImage(300, 200,
null);
success = true;
}
catch (NullPointerException e) {
e.printStackTrace();
success = false;
}
assertTrue(success);
}
示例8: testEquals
import org.jfree.chart.renderer.xy.XYStepAreaRenderer; //导入依赖的package包/类
/**
* Problem that the equals(...) method distinguishes all fields.
*/
public void testEquals() {
XYStepAreaRenderer r1 = new XYStepAreaRenderer();
XYStepAreaRenderer r2 = new XYStepAreaRenderer();
assertEquals(r1, r2);
}
示例9: testPublicCloneable
import org.jfree.chart.renderer.xy.XYStepAreaRenderer; //导入依赖的package包/类
/**
* Verify that this class implements {@link PublicCloneable}.
*/
public void testPublicCloneable() {
XYStepAreaRenderer r1 = new XYStepAreaRenderer();
assertTrue(r1 instanceof PublicCloneable);
}