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


Java LineAndShapeRenderer.setBaseLinesVisible方法代碼示例

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


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

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
public NamedDoubleSeriesChartContainer()
{
	dataset = new DefaultCategoryDataset();
	renderer = new LineAndShapeRenderer();
	renderer.setBaseShapesVisible(false);
	renderer.setBaseLinesVisible(true);
	CategoryPlot plot = new CategoryPlot(dataset, new CategoryAxis(), new NumberAxis(), renderer);
	chart = new JFreeChart(plot);
	plot.setDrawingSupplier(ChartUtils.createDrawingSupplier());
	
}
 
開發者ID:cas-bioinf,項目名稱:cy-dataseries,代碼行數:12,代碼來源:NamedDoubleSeriesChartContainer.java

示例3: 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

示例4: createLineChart

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createLineChart() throws JRException 
{
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart freeChart = 
		ChartFactory.createLineChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression( ((JRLinePlot)getPlot()).getCategoryAxisLabelExpression()),
			evaluateTextExpression(((JRLinePlot)getPlot()).getValueAxisLabelExpression()),
			(CategoryDataset)getDataset(),
			getPlot().getOrientationValue().getOrientation(),
			isShowLegend(),
			true,
			false);

	configureChart(freeChart, getPlot());

	CategoryPlot categoryPlot = (CategoryPlot)freeChart.getPlot();
	JRLinePlot linePlot = (JRLinePlot)getPlot();

	LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer();
	boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
	boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
	
	lineRenderer.setBaseShapesVisible( isShowShapes );//FIXMECHART check this
	lineRenderer.setBaseLinesVisible( isShowLines );
	
	//FIXME labels?

	// Handle the axis formating for the category axis
	configureAxis(categoryPlot.getDomainAxis(), linePlot.getCategoryAxisLabelFont(),
			linePlot.getCategoryAxisLabelColor(), linePlot.getCategoryAxisTickLabelFont(),
			linePlot.getCategoryAxisTickLabelColor(), linePlot.getCategoryAxisTickLabelMask(), linePlot.getCategoryAxisVerticalTickLabels(),
			linePlot.getOwnCategoryAxisLineColor(), false,
			(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMaxValueExpression()));

	// Handle the axis formating for the value axis
	configureAxis(categoryPlot.getRangeAxis(), linePlot.getValueAxisLabelFont(),
			linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(),
			linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(),
			linePlot.getOwnValueAxisLineColor(), true,
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression()));

	return freeChart;
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:47,代碼來源:GenericChartTheme.java

示例5: createLineChart

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createLineChart() throws JRException 
{
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart freeChart = 
		ChartFactory.createLineChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression( ((JRLinePlot)getPlot()).getCategoryAxisLabelExpression()),
			evaluateTextExpression(((JRLinePlot)getPlot()).getValueAxisLabelExpression()),
			(CategoryDataset)getDataset(),
			getPlot().getOrientationValue().getOrientation(),
			isShowLegend(),
			true,
			false);

	configureChart(freeChart, getPlot());

	CategoryPlot categoryPlot = (CategoryPlot)freeChart.getPlot();
	JRLinePlot linePlot = (JRLinePlot)getPlot();

	LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer();
	boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
	boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
	
	lineRenderer.setBaseShapesVisible( isShowShapes );//FIXMECHART check this
	lineRenderer.setBaseLinesVisible( isShowLines );
	
	//FIXME labels?

	// Handle the axis formating for the category axis
	configureAxis(categoryPlot.getDomainAxis(), linePlot.getCategoryAxisLabelFont(),
			linePlot.getCategoryAxisLabelColor(), linePlot.getCategoryAxisTickLabelFont(),
			linePlot.getCategoryAxisTickLabelColor(), linePlot.getCategoryAxisTickLabelMask(), linePlot.getCategoryAxisVerticalTickLabels(),
			linePlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(),
			(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMaxValueExpression())
			);


	// Handle the axis formating for the value axis
	configureAxis(categoryPlot.getRangeAxis(), linePlot.getValueAxisLabelFont(),
			linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(),
			linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(),
			linePlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression())
			);

	return freeChart;
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:50,代碼來源:SimpleChartTheme.java

示例6: createLineChart

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
protected JFreeChart createLineChart() throws JRException 
{
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart = ChartFactory.createLineChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression( ((JRLinePlot)getPlot()).getCategoryAxisLabelExpression()),
			evaluateTextExpression(((JRLinePlot)getPlot()).getValueAxisLabelExpression()),
			(CategoryDataset)getDataset(),
			getPlot().getOrientationValue().getOrientation(),
			isShowLegend(),
			true,
			false);

	configureChart(jfreeChart);

	CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
	JRLinePlot linePlot = (JRLinePlot)getPlot();

	LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer();
	boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
	boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
	
	lineRenderer.setBaseShapesVisible( isShowShapes );//FIXMECHART check this
	lineRenderer.setBaseLinesVisible( isShowLines );
	
	//FIXME labels?

	// Handle the axis formating for the category axis
	configureAxis(categoryPlot.getDomainAxis(), linePlot.getCategoryAxisLabelFont(),
			linePlot.getCategoryAxisLabelColor(), linePlot.getCategoryAxisTickLabelFont(),
			linePlot.getCategoryAxisTickLabelColor(), linePlot.getCategoryAxisTickLabelMask(), linePlot.getCategoryAxisVerticalTickLabels(),
			linePlot.getCategoryAxisLineColor(),  false,
			(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(linePlot.getDomainAxisMaxValueExpression()));

	// Handle the axis formating for the value axis
	configureAxis(categoryPlot.getRangeAxis(), linePlot.getValueAxisLabelFont(),
			linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(),
			linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(),
			linePlot.getValueAxisLineColor(), true,
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression()));

	return jfreeChart;
}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:46,代碼來源:DefaultChartTheme.java

示例7: createCategoryLineChart

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
private JFreeChart createCategoryLineChart(String title, String xLabel, String yLabel, CategoryDataset dataset) {
	  // create the chart...
      JFreeChart chart = ChartFactory.createLineChart(
          title,   // chart title
          xLabel,                       // domain axis label
          yLabel,                       // range axis label
          dataset,                         // data
          orientation,        // orientation
          true,                           // include legend
          true,                            // tooltips
          false                            // urls
      );

      chart.setBackgroundPaint(Color.white);

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

      // customise the range axis...
      NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
      rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

      // customise the renderer...
      LineAndShapeRenderer renderer
          = (LineAndShapeRenderer) plot.getRenderer();
//    System.out.println("lineCondition "+lineCondition);
      if (lineCondition.indexOf("noshape")!=-1)
      		renderer.setBaseShapesVisible(false);
      else  renderer.setBaseShapesVisible(true);

      if (lineCondition.indexOf("noline")!=-1)
      		renderer.setBaseLinesVisible(false);

      if (lineCondition.indexOf("nofill")!=-1){
      		renderer.setBaseShapesFilled(false);
      		renderer.setBaseFillPaint(Color.white);
      		renderer.setDrawOutlines(true);}
       else {
      	 renderer.setBaseShapesFilled(true);
      	 renderer.setUseFillPaint(false);
      	 }
      /*renderer.setShapesVisible(true);
      renderer.setDrawOutlines(true);
      renderer.setUseFillPaint(true);
      renderer.setFillPaint(Color.white);*/
     // renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());

      return chart;

  }
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:52,代碼來源:ChartGenerator_JTable.java

示例8: getIecChart

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
private JFreeChart getIecChart(ThemeDisplay themeDisplay) throws SystemException {
	
	final CategoryDataset porcentajeModulos = getDataSetPercentajes(themeDisplay);
	
	String chartTitle = LanguageUtil.get(themeDisplay.getLocale(), "userprogress.export.pdf.title");
	String chartLabelLegend = LanguageUtil.get(themeDisplay.getLocale(), "userprogress.export.pdf.chart.legend.label");
	String chartLabellLeft = LanguageUtil.get(themeDisplay.getLocale(), "userprogress.export.pdf.chart.label.left");

       final JFreeChart chart = ChartFactory.createBarChart(
       	chartTitle,					// title
       	chartLabelLegend,           // domain axis label
       	chartLabellLeft,            // range axis label
           porcentajeModulos,          // data
           PlotOrientation.VERTICAL,
           true,                     	// legend
           true,                     	// tooltips
           false                     	// url
       );

       chart.setBackgroundPaint(Color.white);

       final CategoryPlot plot = chart.getCategoryPlot();
       plot.setBackgroundPaint(new Color(222,222,222));
       plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
       plot.getRangeAxis(0).setRange(0, 100);
       
       final CategoryAxis domainAxis = plot.getDomainAxis();
       domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_45);
       plot.getRenderer().setSeriesPaint(0, gradientGray);
       
       final CategoryDataset horasRestantes = getDataSetTimeLeft(themeDisplay);
       plot.setDataset(1, horasRestantes);
       plot.mapDatasetToRangeAxis(1, 1);
       
       final ValueAxis axis2 = new NumberAxis(LanguageUtil.get(themeDisplay.getLocale(), "userprogress.export.pdf.chart.label.right"));
       plot.setRangeAxis(1, axis2);
       
       final LineAndShapeRenderer renderer2 = new LineAndShapeRenderer();
       renderer2.setBaseLinesVisible(false);
       renderer2.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
       plot.setRenderer(1, renderer2);
       plot.getRenderer(1).setSeriesPaint(0, gradientBlue);
       
       // Mostrar el primer dataset por debajo del resto de dataset
       plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
       		
	return chart;
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:49,代碼來源:UserProgress.java

示例9: 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

示例10: 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


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