Java Code Examples for org.jfree.chart.renderer.xy.XYBarRenderer#setUseYInterval()
The following examples show how to use
org.jfree.chart.renderer.xy.XYBarRenderer#setUseYInterval() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XYBarRendererTests.java From astor with GNU General Public License v2.0 | 6 votes |
/** * A simple test for the findRangeBounds() method. */ public void testFindRangeBounds() { DefaultIntervalXYDataset dataset = new DefaultIntervalXYDataset(); double[] x = {1.0, 2.0, 3.0, 4.0}; double[] startx = {0.9, 1.8, 2.7, 3.6}; double[] endx = {1.1, 2.2, 3.3, 4.4}; double[] y = {1.0, 2.0, 3.0, 4.0}; double[] starty = {0.9, 1.8, 2.7, 3.6}; double[] endy = {1.1, 2.2, 3.3, 4.4}; double[][] data = new double[][] {x, startx, endx, y, starty, endy}; dataset.addSeries("Series 1", data); XYBarRenderer renderer = new XYBarRenderer(); renderer.setUseYInterval(true); Range r = renderer.findRangeBounds(dataset); assertEquals(0.9, r.getLowerBound(), EPSILON); assertEquals(4.4, r.getUpperBound(), EPSILON); renderer.setUseYInterval(false); r = renderer.findRangeBounds(dataset); assertEquals(1.0, r.getLowerBound(), EPSILON); assertEquals(4.0, r.getUpperBound(), EPSILON); }
Example 2
Source File: XYBarRendererTests.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Test that the equals() method distinguishes all fields. */ public void testEquals() { // default instances XYBarRenderer r1 = new XYBarRenderer(); XYBarRenderer r2 = new XYBarRenderer(); assertTrue(r1.equals(r2)); assertTrue(r2.equals(r1)); // setBase() r1.setBase(1.0); assertFalse(r1.equals(r2)); r2.setBase(1.0); assertTrue(r1.equals(r2)); // setUseYInterval r1.setUseYInterval(!r1.getUseYInterval()); assertFalse(r1.equals(r2)); r2.setUseYInterval(!r2.getUseYInterval()); assertTrue(r1.equals(r2)); // setMargin() r1.setMargin(0.10); assertFalse(r1.equals(r2)); r2.setMargin(0.10); assertTrue(r1.equals(r2)); // setDrawBarOutline() r1.setDrawBarOutline(!r1.isDrawBarOutline()); assertFalse(r1.equals(r2)); r2.setDrawBarOutline(!r2.isDrawBarOutline()); assertTrue(r1.equals(r2)); // setGradientPaintTransformer() r1.setGradientPaintTransformer(new StandardGradientPaintTransformer( GradientPaintTransformType.CENTER_HORIZONTAL)); assertFalse(r1.equals(r2)); r2.setGradientPaintTransformer(new StandardGradientPaintTransformer( GradientPaintTransformType.CENTER_HORIZONTAL)); assertTrue(r1.equals(r2)); // legendBar r1.setLegendBar(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0)); assertFalse(r1.equals(r2)); r2.setLegendBar(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0)); assertTrue(r1.equals(r2)); // positiveItemLabelFallbackPosition r1.setPositiveItemLabelPositionFallback(new ItemLabelPosition()); assertFalse(r1.equals(r2)); r2.setPositiveItemLabelPositionFallback(new ItemLabelPosition()); assertTrue(r1.equals(r2)); // negativeItemLabelFallbackPosition r1.setNegativeItemLabelPositionFallback(new ItemLabelPosition()); assertFalse(r1.equals(r2)); r2.setNegativeItemLabelPositionFallback(new ItemLabelPosition()); assertTrue(r1.equals(r2)); // barPainter r1.setBarPainter(new GradientXYBarPainter(0.11, 0.22, 0.33)); assertFalse(r1.equals(r2)); r2.setBarPainter(new GradientXYBarPainter(0.11, 0.22, 0.33)); assertTrue(r1.equals(r2)); // shadowsVisible r1.setShadowVisible(false); assertFalse(r1.equals(r2)); r2.setShadowVisible(false); assertTrue(r1.equals(r2)); // shadowXOffset r1.setShadowXOffset(3.3); assertFalse(r1.equals(r2)); r2.setShadowXOffset(3.3); assertTrue(r1.equals(r2)); // shadowYOffset r1.setShadowYOffset(3.3); assertFalse(r1.equals(r2)); r2.setShadowYOffset(3.3); assertTrue(r1.equals(r2)); }
Example 3
Source File: XYBarRendererTests.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Test that the equals() method distinguishes all fields. */ public void testEquals() { // default instances XYBarRenderer r1 = new XYBarRenderer(); XYBarRenderer r2 = new XYBarRenderer(); assertTrue(r1.equals(r2)); assertTrue(r2.equals(r1)); // setBase() r1.setBase(1.0); assertFalse(r1.equals(r2)); r2.setBase(1.0); assertTrue(r1.equals(r2)); // setUseYInterval r1.setUseYInterval(!r1.getUseYInterval()); assertFalse(r1.equals(r2)); r2.setUseYInterval(!r2.getUseYInterval()); assertTrue(r1.equals(r2)); // setMargin() r1.setMargin(0.10); assertFalse(r1.equals(r2)); r2.setMargin(0.10); assertTrue(r1.equals(r2)); // setDrawBarOutline() r1.setDrawBarOutline(!r1.isDrawBarOutline()); assertFalse(r1.equals(r2)); r2.setDrawBarOutline(!r2.isDrawBarOutline()); assertTrue(r1.equals(r2)); // setGradientPaintTransformer() r1.setGradientPaintTransformer(new StandardGradientPaintTransformer( GradientPaintTransformType.CENTER_HORIZONTAL)); assertFalse(r1.equals(r2)); r2.setGradientPaintTransformer(new StandardGradientPaintTransformer( GradientPaintTransformType.CENTER_HORIZONTAL)); assertTrue(r1.equals(r2)); // legendBar r1.setLegendBar(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0)); assertFalse(r1.equals(r2)); r2.setLegendBar(new Rectangle2D.Double(1.0, 2.0, 3.0, 4.0)); assertTrue(r1.equals(r2)); // positiveItemLabelFallbackPosition r1.setPositiveItemLabelPositionFallback(new ItemLabelPosition()); assertFalse(r1.equals(r2)); r2.setPositiveItemLabelPositionFallback(new ItemLabelPosition()); assertTrue(r1.equals(r2)); // negativeItemLabelFallbackPosition r1.setNegativeItemLabelPositionFallback(new ItemLabelPosition()); assertFalse(r1.equals(r2)); r2.setNegativeItemLabelPositionFallback(new ItemLabelPosition()); assertTrue(r1.equals(r2)); }