當前位置: 首頁>>代碼示例>>Java>>正文


Java LineAndShapeRenderer.setSeriesLinesVisible方法代碼示例

本文整理匯總了Java中org.jfree.chart.renderer.category.LineAndShapeRenderer.setSeriesLinesVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java LineAndShapeRenderer.setSeriesLinesVisible方法的具體用法?Java LineAndShapeRenderer.setSeriesLinesVisible怎麽用?Java LineAndShapeRenderer.setSeriesLinesVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.renderer.category.LineAndShapeRenderer的用法示例。


在下文中一共展示了LineAndShapeRenderer.setSeriesLinesVisible方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: styleChart

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
/** 
 * TODO Documentation
 * 
 * @param chart
 * @return
 */
protected JFreeChart styleChart(JFreeChart chart) {
	chart.setBackgroundPaint(Color.white);
       LegendTitle legend = chart.getLegend();
       legend.setPosition(RectangleEdge.RIGHT);
       legend.setVisible(false);

       final CategoryPlot plot = chart.getCategoryPlot();
       plot.setBackgroundPaint(Color.white);
       plot.setRangeGridlinePaint(Color.lightGray);      

       final LineAndShapeRenderer renderer = new LineAndShapeRenderer();
       renderer.setSeriesLinesVisible(0,true);
       renderer.setSeriesShapesVisible(1, true);
       renderer.setBaseLinesVisible(true);
       renderer.setBaseShapesFilled(true);
       plot.setDomainGridlinesVisible(true);
       plot.setDomainGridlinePaint(Color.lightGray);
       plot.setRenderer(renderer);
       // customise the range axis...
       final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
       rangeAxis.setAutoRangeIncludesZero(false);
       rangeAxis.setStandardTickUnits(rangeAxis.getStandardTickUnits());
       
       return chart;
}
 
開發者ID:modsim,項目名稱:vizardous,代碼行數:32,代碼來源:CorrelationChart2D.java

示例2: configureLineAndShapeRenderer

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
private static void configureLineAndShapeRenderer(LineAndShapeRenderer renderer, ValueSource valueSource, PlotInstance plotInstance) {
	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) {
		// configure linestyle
		if(seriesFormat.getLineStyle() != LineStyle.NONE) {
			renderer.setSeriesLinesVisible(seriesIdx, true);
			renderer.setSeriesStroke(seriesIdx, seriesFormat.getStroke(),false);
		} else {
			renderer.setSeriesLinesVisible(seriesIdx, false);
		}

		// configure series shape if necessary
		if(!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, shapeDimensionConfig) ){
			if(seriesFormat.getItemShape() != ItemShape.NONE) {
				renderer.setSeriesShapesVisible(seriesIdx, true);
				renderer.setSeriesShape(seriesIdx, seriesFormat.getItemShape().getShape());
			} else {
				renderer.setSeriesShapesVisible(seriesIdx, false);	
			}
		}

		// 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);
	}
}
 
開發者ID:rapidminer,項目名稱:rapidminer-5,代碼行數:40,代碼來源:ChartRendererFactory.java

示例3: configureLineAndShapeRenderer

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
private static void configureLineAndShapeRenderer(LineAndShapeRenderer renderer, ValueSource valueSource,
		PlotInstance plotInstance) {
	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) {
		// configure linestyle
		if (seriesFormat.getLineStyle() != LineStyle.NONE) {
			renderer.setSeriesLinesVisible(seriesIdx, true);
			renderer.setSeriesStroke(seriesIdx, seriesFormat.getStroke(), false);
		} else {
			renderer.setSeriesLinesVisible(seriesIdx, false);
		}

		// configure series shape if necessary
		if (!SeriesFormat.calculateIndividualFormatForEachItem(domainConfig, shapeDimensionConfig)) {
			if (seriesFormat.getItemShape() != ItemShape.NONE) {
				renderer.setSeriesShapesVisible(seriesIdx, true);
				renderer.setSeriesShape(seriesIdx, seriesFormat.getItemShape().getShape());
			} else {
				renderer.setSeriesShapesVisible(seriesIdx, false);
			}
		}

		// 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);
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:43,代碼來源:ChartRendererFactory.java

示例4: testEquals

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    
    LineAndShapeRenderer r1 = new LineAndShapeRenderer();
    LineAndShapeRenderer r2 = new LineAndShapeRenderer();
    assertEquals(r1, r2);
    
    r1.setBaseLinesVisible(!r1.getBaseLinesVisible());
    assertFalse(r1.equals(r2));
    r2.setBaseLinesVisible(r1.getBaseLinesVisible());
    assertTrue(r1.equals(r2));
    
    r1.setSeriesLinesVisible(1, true);
    assertFalse(r1.equals(r2));
    r2.setSeriesLinesVisible(1, true);
    assertTrue(r1.equals(r2));
    
    r1.setLinesVisible(false);
    assertFalse(r1.equals(r2));
    r2.setLinesVisible(false);
    assertTrue(r1.equals(r2));
    
    r1.setBaseShapesVisible(!r1.getBaseShapesVisible());
    assertFalse(r1.equals(r2));
    r2.setBaseShapesVisible(r1.getBaseShapesVisible());
    assertTrue(r1.equals(r2));
    
    r1.setSeriesShapesVisible(1, true);
    assertFalse(r1.equals(r2));
    r2.setSeriesShapesVisible(1, true);
    assertTrue(r1.equals(r2));
    
    r1.setShapesVisible(false);
    assertFalse(r1.equals(r2));
    r2.setShapesVisible(false);
    assertTrue(r1.equals(r2));

    r1.setShapesFilled(false);
    assertFalse(r1.equals(r2));
    r2.setShapesFilled(false);
    assertTrue(r1.equals(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.setUseOutlinePaint(true);
    assertFalse(r1.equals(r2));
    r2.setUseOutlinePaint(true);
    assertTrue(r1.equals(r2));
    
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:61,代碼來源:LineAndShapeRendererTests.java

示例5: testEquals

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {

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

    r1.setBaseLinesVisible(!r1.getBaseLinesVisible());
    assertFalse(r1.equals(r2));
    r2.setBaseLinesVisible(r1.getBaseLinesVisible());
    assertTrue(r1.equals(r2));

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

    r1.setBaseShapesVisible(!r1.getBaseShapesVisible());
    assertFalse(r1.equals(r2));
    r2.setBaseShapesVisible(r1.getBaseShapesVisible());
    assertTrue(r1.equals(r2));

    r1.setSeriesShapesVisible(1, true);
    assertFalse(r1.equals(r2));
    r2.setSeriesShapesVisible(1, true);
    assertTrue(r1.equals(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.setUseOutlinePaint(true);
    assertFalse(r1.equals(r2));
    r2.setUseOutlinePaint(true);
    assertTrue(r1.equals(r2));

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

    r1.setItemMargin(0.14);
    assertFalse(r1.equals(r2));
    r2.setItemMargin(0.14);
    assertTrue(r1.equals(r2));

}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:56,代碼來源:LineAndShapeRendererTests.java

示例6: checkIndependence

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
/**
 * Checks that the two renderers are equal but independent of one another.
 *
 * @param r1  renderer 1.
 * @param r2  renderer 2.
 *
 * @return A boolean.
 */
private boolean checkIndependence(LineAndShapeRenderer r1,
                                  LineAndShapeRenderer r2) {

    // should be equal...
    if (!r1.equals(r2)) {
        return false;
    }

    // and independent...
    r1.setBaseLinesVisible(!r1.getBaseLinesVisible());
    if (r1.equals(r2)) {
        return false;
    }
    r2.setBaseLinesVisible(r1.getBaseLinesVisible());
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setSeriesLinesVisible(1, true);
    if (r1.equals(r2)) {
        return false;
    }
    r2.setSeriesLinesVisible(1, true);
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setBaseShapesVisible(!r1.getBaseShapesVisible());
    if (r1.equals(r2)) {
        return false;
    }
    r2.setBaseShapesVisible(r1.getBaseShapesVisible());
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setSeriesShapesVisible(1, true);
    if (r1.equals(r2)) {
        return false;
    }
    r2.setSeriesShapesVisible(1, true);
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setSeriesShapesFilled(0, false);
    r2.setSeriesShapesFilled(0, true);
    if (r1.equals(r2)) {
        return false;
    }
    r2.setSeriesShapesFilled(0, false);
    if (!r1.equals(r2)) {
        return false;
    }

    r1.setBaseShapesFilled(false);
    r2.setBaseShapesFilled(true);
    if (r1.equals(r2)) {
        return false;
    }
    r2.setBaseShapesFilled(false);
    if (!r1.equals(r2)) {
        return false;
    }
    return true;

}
 
開發者ID:SpoonLabs,項目名稱:astor,代碼行數:76,代碼來源:LineAndShapeRendererTests.java

示例7: createPlotComponent

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
private Component createPlotComponent() {
    
    boolean legend = true;
    boolean tooltips = false;
    boolean urls = false;
    chart = ChartFactory.createLineChart(null, null, null, 
            dataSet, PlotOrientation.VERTICAL, legend, tooltips, urls);
    
    CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.GRAY);
    plot.setRangeGridlinesVisible(true);
    plot.setDomainGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.WHITE);
    
    NumberAxis axis = (NumberAxis) plot.getRangeAxis();
    axis.setAutoRangeIncludesZero(false);
    axis.setAutoRangeStickyZero(true);
    
    renderer = plot.getRenderer();
    if(renderer instanceof LineAndShapeRenderer) {
        LineAndShapeRenderer lasr = (LineAndShapeRenderer) renderer;
        lasr.setBaseShapesVisible(true);
        lasr.setDrawOutlines(true);
        lasr.setUseFillPaint(true);
        lasr.setBaseStroke(new BasicStroke(2));

        
        int r = 3;
        Shape circle = new Ellipse2D.Float(-r, -r, 2*r, 2*r);
        int count = dataSet.getRowCount();
        for(int i=0; i<count; i++) {
            PlotLabel label = (PlotLabel) dataSet.getRowKey(i);
            boolean isLr = label.getId() >= developments;
            
            Color color = isLr? LINK_RATIO : FACTOR;
            lasr.setSeriesPaint(i, color);
            lasr.setSeriesFillPaint(i, color);
            lasr.setSeriesShape(i, circle);
            
            lasr.setSeriesShapesVisible(i, !isLr);
            lasr.setSeriesLinesVisible(i, isLr);
        }
    }
    
    return new ChartPanel(chart);
}
 
開發者ID:Depter,項目名稱:JRLib,代碼行數:48,代碼來源:DevelopmentFactorPlot.java


注:本文中的org.jfree.chart.renderer.category.LineAndShapeRenderer.setSeriesLinesVisible方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。