Java Code Examples for org.jfree.chart.renderer.category.ScatterRenderer#setUseSeriesOffset()

The following examples show how to use org.jfree.chart.renderer.category.ScatterRenderer#setUseSeriesOffset() . 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: ChartRendererFactory.java    From rapidminer-studio with GNU Affero General Public License v3.0 5 votes vote down vote up
private static void configureScatterRenderer(ScatterRenderer renderer, ValueSource valueSource, PlotInstance plotInstance)
		throws ChartPlottimeException {
	ValueSourceData valueSourceData = plotInstance.getPlotData().getValueSourceData(valueSource);
	int seriesCount = valueSourceData.getSeriesCount();
	SeriesFormat seriesFormat = valueSource.getSeriesFormat();
	DimensionConfig domainConfig = valueSource.getDomainConfig();
	DimensionConfig colorDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(
			PlotDimension.COLOR);
	DimensionConfig shapeDimensionConfig = plotInstance.getCurrentPlotConfigurationClone().getDimensionConfig(
			PlotDimension.SHAPE);

	renderer.setDefaultEntityRadius(4);

	// loop all series and set series format
	for (int seriesIdx = 0; seriesIdx < seriesCount; ++seriesIdx) {
		// lines are not supported in a ScatterRenderer, but this is already checked in
		// JFreeChartPlotEngine.getWarnings().

		// configure series shape if necessary
		if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, shapeDimensionConfig)) {
			// if(seriesFormat.getItemShape() != ItemShape.NONE) {
			renderer.setSeriesShape(seriesIdx, seriesFormat.getItemShape().getShape());
			// } else {
			// throw new ChartPlottimeException("unsupported_item_shape",
			// valueSource.toString(), seriesFormat.getItemShape());
			// }
		}

		// configure series color if necessary
		if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, colorDimensionConfig)) {
			Color itemColor = seriesFormat.getItemColor();
			renderer.setSeriesPaint(seriesIdx, itemColor);
		}
		renderer.setSeriesOutlinePaint(seriesIdx, PlotConfiguration.DEFAULT_SERIES_OUTLINE_PAINT);
		renderer.setUseOutlinePaint(true);
		renderer.setDrawOutlines(true);
		renderer.setUseSeriesOffset(false);
	}
}
 
Example 2
Source File: ScatterRendererTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {

    ScatterRenderer r1 = new ScatterRenderer();
    ScatterRenderer r2 = new ScatterRenderer();
    assertEquals(r1, r2);

    r1.setSeriesShapesFilled(1, true);
    assertFalse(r1.equals(r2));
    r2.setSeriesShapesFilled(1, true);
    assertTrue(r1.equals(r2));

    r1.setBaseShapesFilled(false);
    assertFalse(r1.equals(r2));
    r2.setBaseShapesFilled(false);
    assertTrue(r1.equals(r2));

    r1.setUseFillPaint(true);
    assertFalse(r1.equals(r2));
    r2.setUseFillPaint(true);
    assertTrue(r1.equals(r2));

    r1.setDrawOutlines(true);
    assertFalse(r1.equals(r2));
    r2.setDrawOutlines(true);
    assertTrue(r1.equals(r2));

    r1.setUseOutlinePaint(true);
    assertFalse(r1.equals(r2));
    r2.setUseOutlinePaint(true);
    assertTrue(r1.equals(r2));

    r1.setUseSeriesOffset(false);
    assertFalse(r1.equals(r2));
    r2.setUseSeriesOffset(false);
    assertTrue(r1.equals(r2));

}
 
Example 3
Source File: ScatterRendererTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    
    ScatterRenderer r1 = new ScatterRenderer();
    ScatterRenderer r2 = new ScatterRenderer();
    assertEquals(r1, r2);
    
    r1.setSeriesShapesFilled(1, true);
    assertFalse(r1.equals(r2));
    r2.setSeriesShapesFilled(1, true);
    assertTrue(r1.equals(r2));
    
    r1.setBaseShapesFilled(false);
    assertFalse(r1.equals(r2));
    r2.setBaseShapesFilled(false);
    assertTrue(r1.equals(r2));
    
    r1.setUseFillPaint(true);
    assertFalse(r1.equals(r2));
    r2.setUseFillPaint(true);
    assertTrue(r1.equals(r2));
    
    r1.setDrawOutlines(true);
    assertFalse(r1.equals(r2));
    r2.setDrawOutlines(true);
    assertTrue(r1.equals(r2));
    
    r1.setUseOutlinePaint(true);
    assertFalse(r1.equals(r2));
    r2.setUseOutlinePaint(true);
    assertTrue(r1.equals(r2));
    
    r1.setUseSeriesOffset(false);
    assertFalse(r1.equals(r2));
    r2.setUseSeriesOffset(false);
    assertTrue(r1.equals(r2));
    
}