当前位置: 首页>>代码示例>>Java>>正文


Java XYLineAndShapeRenderer.setBaseLinesVisible方法代码示例

本文整理汇总了Java中org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setBaseLinesVisible方法的典型用法代码示例。如果您正苦于以下问题:Java XYLineAndShapeRenderer.setBaseLinesVisible方法的具体用法?Java XYLineAndShapeRenderer.setBaseLinesVisible怎么用?Java XYLineAndShapeRenderer.setBaseLinesVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.renderer.xy.XYLineAndShapeRenderer的用法示例。


在下文中一共展示了XYLineAndShapeRenderer.setBaseLinesVisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createLegend

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createLegend(XYDataset dataset) {
    
    JFreeChart chart = ChartFactory.createXYLineChart(
        chartTitle,             // chart title
        "Category",               // domain axis label
        "Value",                  // range axis label
        dataset,                  // data
        PlotOrientation.VERTICAL, // orientation
        true,                     // include legend
        true,                     // tooltips
        false                     // url
    );
 
    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
    chart.setBackgroundPaint(Color.white);
    XYPlot plot = (XYPlot) chart.getPlot();

    XYLineAndShapeRenderer renderer 
    = (XYLineAndShapeRenderer) plot.getRenderer();
    renderer.setBaseLinesVisible(false);
    renderer.setBaseShapesVisible(true);
    renderer.setBaseShapesFilled(true);
    plot.setRenderer(renderer);
    return chart;
    
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:27,代码来源:LineChartDemo6.java

示例2: createScatterChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
@Override
protected JFreeChart createScatterChart() throws JRException
{
	JFreeChart jfreeChart = super.createScatterChart();
	XYPlot xyPlot = (XYPlot) jfreeChart.getPlot();
	
	xyPlot.setRangeGridlinePaint(SCATTER_GRIDLINE_COLOR);
	xyPlot.setRangeGridlineStroke(new BasicStroke(0.75f));
	xyPlot.setDomainGridlinesVisible(true);
	xyPlot.setDomainGridlinePaint(SCATTER_GRIDLINE_COLOR);
	xyPlot.setDomainGridlineStroke(new BasicStroke(0.75f));
	xyPlot.setRangeZeroBaselinePaint(ChartThemesConstants.GRAY_PAINT_134);

	XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer)xyPlot.getRenderer();
	lineRenderer.setUseFillPaint(true);
	JRScatterPlot scatterPlot = (JRScatterPlot) getPlot();
	boolean isShowLines = scatterPlot.getShowLines() == null ? false : scatterPlot.getShowLines().booleanValue();
	lineRenderer.setBaseLinesVisible(isShowLines);
	XYDataset xyDataset = xyPlot.getDataset();
	if (xyDataset != null)
	{
		for (int i = 0; i < xyDataset.getSeriesCount(); i++)
		{
			lineRenderer.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);
			lineRenderer.setSeriesFillPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
			lineRenderer.setSeriesPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_COLORS.get(i));
			//lineRenderer.setSeriesShape(i, new Ellipse2D.Double(-3, -3, 6, 6));
		}
	}
	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:32,代码来源:EyeCandySixtiesChartTheme.java

示例3: TimeSeriesChartContainer

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public TimeSeriesChartContainer()
{
	dataset = new DefaultXYDataset();
	renderer = new XYLineAndShapeRenderer();
	renderer.setBaseShapesVisible(false);
	renderer.setBaseLinesVisible(true);
	XYPlot plot = new XYPlot(dataset, new NumberAxis("Time"), new NumberAxis(), renderer);
	chart = new JFreeChart(plot);
	plot.setDrawingSupplier(ChartUtils.createDrawingSupplier());
	
}
 
开发者ID:cas-bioinf,项目名称:cy-dataseries,代码行数:12,代码来源:TimeSeriesChartContainer.java

示例4: createChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private void createChart(){
		JFreeChart chart = ChartFactory.createXYLineChart(
				"plotting", // chart title
	            "X Axis", // x axis label
	            "Y Axis", // y axis label
	            createMultiple(datas.length), // data 
	            PlotOrientation.VERTICAL,
	            true, // include legend
	            true, // tooltips
	            true // urls
	            );	

		XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
		renderer.setBaseShapesVisible(false);
		renderer.setBaseLinesVisible(true);
		XYPlot plot = (XYPlot) chart.getPlot();
	    plot.setRenderer(renderer);  
	    if(annotation != null){
	    	for (int i = 1; i < annotation.length; i++) {
				plot.addAnnotation(annotation[i]);
		    }
	    }
	    ChartFrame frame = new ChartFrame("Multiple Plot", chart);
//	    frame.getChartPanel().setRangeZoomable(false);
	    frame.setVisible(true);
	    frame.pack();
	}
 
开发者ID:miracatici,项目名称:MakamBox,代码行数:28,代码来源:Plot.java

示例5: createChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
   * Creates a chart.
   * 
   * @param dataset  the data for the chart.
   * 
   * @return a chart.
   */
  protected JFreeChart createChart(XYDataset dataset) {
      
      // create the chart...
      JFreeChart chart = ChartFactory.createXYLineChart(
          chartTitle,      // chart title
          domainLabel,                      // x axis label
          rangeLabel,                      // y axis label
          dataset,                  // data
          PlotOrientation.VERTICAL,
          !legendPanelOn,                     // include legend
          true,                     // tooltips
          false                     // urls
      );

      chart.setBackgroundPaint(Color.white);
      
      // get a reference to the plot for further customisation...
      XYPlot plot = chart.getXYPlot();
      plot.setBackgroundPaint(Color.lightGray);
      plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
      plot.setDomainGridlinePaint(Color.white);
      plot.setRangeGridlinePaint(Color.white);
      
      XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
// renderer.setSeriesLinesVisible(0, false);
//   renderer.setSeriesShapesVisible(1, false);
      renderer.setBaseLinesVisible(false);

      plot.setRenderer(renderer);

      // change the auto tick unit selection to integer units only...
      NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
      rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
      // OPTIONAL CUSTOMISATION COMPLETED.
              
      return chart;
      
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:46,代码来源:LineChartDemo6.java

示例6: createXYSymbolicAxisChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private JFreeChart createXYSymbolicAxisChart(String title, XYDataset dataset) {
 SymbolAxis domainAxis = new SymbolAxis("Domain",
            new String[] {"A", "B", "C", "D"});
    SymbolAxis rangeAxis = new SymbolAxis("Range",
            new String[] {"V", "X", "Y", "Z"});
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(false, true);
//renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());

    XYPlot plot = new XYPlot(dataset, domainAxis, rangeAxis, renderer);
    JFreeChart chart = new JFreeChart("SymbolicAxis Demo 1", plot);

    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.setUseFillPaint(true);
//renderer.setFillPaint(Color.white);

    return chart;
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:33,代码来源:ChartGenerator_JTable.java

示例7: testEquals

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
 * Test that the equals() method distinguishes all fields.
 */
public void testEquals() {
    
    XYLineAndShapeRenderer r1 = new XYLineAndShapeRenderer();
    XYLineAndShapeRenderer r2 = new XYLineAndShapeRenderer();
    assertEquals(r1, r2);
    assertEquals(r2, r1);

    r1.setLinesVisible(true);
    assertFalse(r1.equals(r2));
    r2.setLinesVisible(true);
    assertTrue(r1.equals(r2));
    
    r1.setSeriesLinesVisible(3, true);
    assertFalse(r1.equals(r2));
    r2.setSeriesLinesVisible(3, true);
    assertTrue(r1.equals(r2));
    
    r1.setBaseLinesVisible(false);
    assertFalse(r1.equals(r2));
    r2.setBaseLinesVisible(false);
    assertTrue(r1.equals(r2));
    
    r1.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
    assertFalse(r1.equals(r2));
    r2.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
    assertTrue(r1.equals(r2));
    
    r1.setShapesVisible(true);
    assertFalse(r1.equals(r2));
    r2.setShapesVisible(true);
    assertTrue(r1.equals(r2));
    
    r1.setSeriesShapesVisible(3, true);
    assertFalse(r1.equals(r2));
    r2.setSeriesShapesVisible(3, true);
    assertTrue(r1.equals(r2));
    
    r1.setBaseShapesVisible(false);
    assertFalse(r1.equals(r2));
    r2.setBaseShapesVisible(false);
    assertTrue(r1.equals(r2));
    
    r1.setShapesFilled(true);
    assertFalse(r1.equals(r2));
    r2.setShapesFilled(true);
    assertTrue(r1.equals(r2));
    
    r1.setSeriesShapesFilled(3, true);
    assertFalse(r1.equals(r2));
    r2.setSeriesShapesFilled(3, true);
    assertTrue(r1.equals(r2));
    
    r1.setBaseShapesFilled(false);
    assertFalse(r1.equals(r2));
    r2.setBaseShapesFilled(false);
    assertTrue(r1.equals(r2));

    r1.setDrawOutlines(!r1.getDrawOutlines());
    assertFalse(r1.equals(r2));
    r2.setDrawOutlines(r1.getDrawOutlines());
    assertTrue(r1.equals(r2));

    r1.setUseOutlinePaint(true);
    assertFalse(r1.equals(r2));
    r2.setUseOutlinePaint(true);
    assertTrue(r1.equals(r2));
    
    r1.setUseFillPaint(true);
    assertFalse(r1.equals(r2));
    r2.setUseFillPaint(true);
    assertTrue(r1.equals(r2));
    
    r1.setDrawSeriesLineAsPath(true);
    assertFalse(r1.equals(r2));
    r2.setDrawSeriesLineAsPath(true);
    assertTrue(r1.equals(r2));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:81,代码来源:XYLineAndShapeRendererTests.java

示例8: createScatterChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createScatterChart() throws JRException 
{
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart = 
		ChartFactory.createScatterPlot(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRScatterPlot)getPlot()).getXAxisLabelExpression()),
			evaluateTextExpression(((JRScatterPlot)getPlot()).getYAxisLabelExpression()),
			(XYDataset)getDataset(),
			getPlot().getOrientationValue().getOrientation(),
			isShowLegend(),
			true,
			false);

	configureChart(jfreeChart, getPlot());
	XYLineAndShapeRenderer plotRenderer = (XYLineAndShapeRenderer) ((XYPlot)jfreeChart.getPlot()).getRenderer();

	JRScatterPlot scatterPlot = (JRScatterPlot) getPlot();
	boolean isShowLines = scatterPlot.getShowLines() == null ? true : scatterPlot.getShowLines().booleanValue();
	boolean isShowShapes = scatterPlot.getShowShapes() == null ? true : scatterPlot.getShowShapes().booleanValue();
	
	plotRenderer.setBaseLinesVisible(isShowLines);
	plotRenderer.setBaseShapesVisible(isShowShapes);

	// Handle the axis formating for the category axis
	configureAxis(jfreeChart.getXYPlot().getDomainAxis(), scatterPlot.getXAxisLabelFont(),
			scatterPlot.getXAxisLabelColor(), scatterPlot.getXAxisTickLabelFont(),
			scatterPlot.getXAxisTickLabelColor(), scatterPlot.getXAxisTickLabelMask(), scatterPlot.getXAxisVerticalTickLabels(),
			scatterPlot.getOwnXAxisLineColor(), false,
			(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMaxValueExpression()));

	// Handle the axis formating for the value axis
	configureAxis(jfreeChart.getXYPlot().getRangeAxis(), scatterPlot.getYAxisLabelFont(),
			scatterPlot.getYAxisLabelColor(), scatterPlot.getYAxisTickLabelFont(),
			scatterPlot.getYAxisTickLabelColor(), scatterPlot.getYAxisTickLabelMask(), scatterPlot.getYAxisVerticalTickLabels(),
			scatterPlot.getOwnYAxisLineColor(), true, 
			(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMaxValueExpression()));

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:43,代码来源:GenericChartTheme.java

示例9: createXyLineChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createXyLineChart() throws JRException 
{
	JRLinePlot linePlot = (JRLinePlot) getPlot();

	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart = 
		ChartFactory.createXYLineChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(linePlot.getCategoryAxisLabelExpression()),
			evaluateTextExpression(linePlot.getValueAxisLabelExpression()),
			(XYDataset)getDataset(),
			linePlot.getOrientationValue().getOrientation(),
			isShowLegend(),
			true,
			false);

	configureChart(jfreeChart, getPlot());

	// Handle the axis formating for the category axis
	configureAxis(jfreeChart.getXYPlot().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(jfreeChart.getXYPlot().getRangeAxis(), linePlot.getValueAxisLabelFont(),
			linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(),
			linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(),
			linePlot.getOwnValueAxisLineColor(), true,
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression()));

	XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer) jfreeChart.getXYPlot().getRenderer();
	boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
	boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
	lineRenderer.setBaseShapesVisible(isShowShapes);
	lineRenderer.setBaseLinesVisible(isShowLines);

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:43,代码来源:GenericChartTheme.java

示例10: createTimeSeriesChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createTimeSeriesChart() throws JRException 
{
	String timeAxisLabel = evaluateTextExpression(((JRTimeSeriesPlot)getPlot()).getTimeAxisLabelExpression());
	String valueAxisLabel = evaluateTextExpression(((JRTimeSeriesPlot)getPlot()).getValueAxisLabelExpression());

	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart = 
		ChartFactory.createTimeSeriesChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			timeAxisLabel,
			valueAxisLabel,
			(TimeSeriesCollection)getDataset(),
			isShowLegend(),
			true,
			false );

	configureChart(jfreeChart, getPlot());

	XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
	JRTimeSeriesPlot timeSeriesPlot = (JRTimeSeriesPlot)getPlot();
	
	XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer)xyPlot.getRenderer();
	
	boolean isShowShapes = timeSeriesPlot.getShowShapes() == null ? true : timeSeriesPlot.getShowShapes().booleanValue();
	boolean isShowLines = timeSeriesPlot.getShowLines() == null ? true : timeSeriesPlot.getShowLines().booleanValue();
	lineRenderer.setBaseLinesVisible(isShowLines);
	lineRenderer.setBaseShapesVisible(isShowShapes);
	
	// Handle the axis formating for the category axis
	configureAxis(xyPlot.getDomainAxis(), timeSeriesPlot.getTimeAxisLabelFont(),
			timeSeriesPlot.getTimeAxisLabelColor(), timeSeriesPlot.getTimeAxisTickLabelFont(),
			timeSeriesPlot.getTimeAxisTickLabelColor(), timeSeriesPlot.getTimeAxisTickLabelMask(), timeSeriesPlot.getTimeAxisVerticalTickLabels(),
			timeSeriesPlot.getOwnTimeAxisLineColor(), false,
			(Comparable<?>)evaluateExpression(timeSeriesPlot.getDomainAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(timeSeriesPlot.getDomainAxisMaxValueExpression()));

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

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:47,代码来源:GenericChartTheme.java

示例11: createScatterChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createScatterChart() throws JRException 
{
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart = 
		ChartFactory.createScatterPlot(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRScatterPlot)getPlot()).getXAxisLabelExpression()),
			evaluateTextExpression(((JRScatterPlot)getPlot()).getYAxisLabelExpression()),
			(XYDataset)getDataset(),
			getPlot().getOrientationValue().getOrientation(),
			isShowLegend(),
			true,
			false);

	configureChart(jfreeChart, getPlot());
	XYLineAndShapeRenderer plotRenderer = (XYLineAndShapeRenderer) ((XYPlot)jfreeChart.getPlot()).getRenderer();

	JRScatterPlot scatterPlot = (JRScatterPlot) getPlot();
	boolean isShowLines = scatterPlot.getShowLines() == null ? true : scatterPlot.getShowLines().booleanValue();
	boolean isShowShapes = scatterPlot.getShowShapes() == null ? true : scatterPlot.getShowShapes().booleanValue();
	
	plotRenderer.setBaseLinesVisible(isShowLines);
	plotRenderer.setBaseShapesVisible(isShowShapes);

	// Handle the axis formating for the category axis
	configureAxis(jfreeChart.getXYPlot().getDomainAxis(), scatterPlot.getXAxisLabelFont(),
			scatterPlot.getXAxisLabelColor(), scatterPlot.getXAxisTickLabelFont(),
			scatterPlot.getXAxisTickLabelColor(), scatterPlot.getXAxisTickLabelMask(), scatterPlot.getXAxisVerticalTickLabels(),
			scatterPlot.getOwnXAxisLineColor(), getDomainAxisSettings(),
			(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMaxValueExpression()));

	// Handle the axis formating for the value axis
	configureAxis(jfreeChart.getXYPlot().getRangeAxis(), scatterPlot.getYAxisLabelFont(),
			scatterPlot.getYAxisLabelColor(), scatterPlot.getYAxisTickLabelFont(),
			scatterPlot.getYAxisTickLabelColor(), scatterPlot.getYAxisTickLabelMask(), scatterPlot.getYAxisVerticalTickLabels(),
			scatterPlot.getOwnYAxisLineColor(), getRangeAxisSettings(),
			(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMaxValueExpression()));


	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:44,代码来源:SimpleChartTheme.java

示例12: createXyLineChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createXyLineChart() throws JRException 
{
	JRLinePlot linePlot = (JRLinePlot) getPlot();

	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart = 
		ChartFactory.createXYLineChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(linePlot.getCategoryAxisLabelExpression()),
			evaluateTextExpression(linePlot.getValueAxisLabelExpression()),
			(XYDataset)getDataset(),
			linePlot.getOrientationValue().getOrientation(),
			isShowLegend(),
			true,
			false);

	configureChart(jfreeChart, getPlot());

	// Handle the axis formating for the category axis
	configureAxis(jfreeChart.getXYPlot().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(jfreeChart.getXYPlot().getRangeAxis(), linePlot.getValueAxisLabelFont(),
			linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(),
			linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(),
			linePlot.getOwnValueAxisLineColor(), getRangeAxisSettings(),
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression())
			);

	XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer) jfreeChart.getXYPlot().getRenderer();
	boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
	boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
	lineRenderer.setBaseShapesVisible(isShowShapes);
	lineRenderer.setBaseLinesVisible(isShowLines);

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:46,代码来源:SimpleChartTheme.java

示例13: createTimeSeriesChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createTimeSeriesChart() throws JRException 
{
	String timeAxisLabel = evaluateTextExpression(((JRTimeSeriesPlot)getPlot()).getTimeAxisLabelExpression());
	String valueAxisLabel = evaluateTextExpression(((JRTimeSeriesPlot)getPlot()).getValueAxisLabelExpression());

	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart = 
		ChartFactory.createTimeSeriesChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			timeAxisLabel,
			valueAxisLabel,
			(TimeSeriesCollection)getDataset(),
			isShowLegend(),
			true,
			false );

	configureChart(jfreeChart, getPlot());

	XYPlot xyPlot = (XYPlot)jfreeChart.getPlot();
	JRTimeSeriesPlot timeSeriesPlot = (JRTimeSeriesPlot)getPlot();
	
	XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer)xyPlot.getRenderer();
	
	boolean isShowShapes = timeSeriesPlot.getShowShapes() == null ? true : timeSeriesPlot.getShowShapes().booleanValue();
	boolean isShowLines = timeSeriesPlot.getShowLines() == null ? true : timeSeriesPlot.getShowLines().booleanValue();
	lineRenderer.setBaseLinesVisible(isShowLines);
	lineRenderer.setBaseShapesVisible(isShowShapes);
	
	// Handle the axis formating for the category axis
	configureAxis(xyPlot.getDomainAxis(), timeSeriesPlot.getTimeAxisLabelFont(),
			timeSeriesPlot.getTimeAxisLabelColor(), timeSeriesPlot.getTimeAxisTickLabelFont(),
			timeSeriesPlot.getTimeAxisTickLabelColor(), timeSeriesPlot.getTimeAxisTickLabelMask(), timeSeriesPlot.getTimeAxisVerticalTickLabels(),
			timeSeriesPlot.getOwnTimeAxisLineColor(), getDomainAxisSettings(), DateTickUnitType.DAY,
			(Comparable<?>)evaluateExpression(timeSeriesPlot.getDomainAxisMinValueExpression()), 
			(Comparable<?>)evaluateExpression(timeSeriesPlot.getDomainAxisMaxValueExpression())
			);

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

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:49,代码来源:SimpleChartTheme.java

示例14: createScatterChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createScatterChart() throws JRException 
{
	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart = ChartFactory.createScatterPlot(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(((JRScatterPlot)getPlot()).getXAxisLabelExpression()),
			evaluateTextExpression(((JRScatterPlot)getPlot()).getYAxisLabelExpression() ),
			(XYDataset)getDataset(),
			getPlot().getOrientationValue().getOrientation(),
			isShowLegend(),
			true,
			false);

	configureChart(jfreeChart);
	XYLineAndShapeRenderer plotRenderer = (XYLineAndShapeRenderer) ((XYPlot)jfreeChart.getPlot()).getRenderer();

	JRScatterPlot scatterPlot = (JRScatterPlot) getPlot();
	boolean isShowLines = scatterPlot.getShowLines() == null ? true : scatterPlot.getShowLines().booleanValue();
	boolean isShowShapes = scatterPlot.getShowShapes() == null ? true : scatterPlot.getShowShapes().booleanValue();
	
	plotRenderer.setBaseLinesVisible(isShowLines);
	plotRenderer.setBaseShapesVisible(isShowShapes);

	// Handle the axis formating for the category axis
	configureAxis(jfreeChart.getXYPlot().getDomainAxis(), scatterPlot.getXAxisLabelFont(),
			scatterPlot.getXAxisLabelColor(), scatterPlot.getXAxisTickLabelFont(),
			scatterPlot.getXAxisTickLabelColor(), scatterPlot.getXAxisTickLabelMask(), scatterPlot.getXAxisVerticalTickLabels(),
			scatterPlot.getXAxisLineColor(), false,
			(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(scatterPlot.getDomainAxisMaxValueExpression()));

	// Handle the axis formating for the value axis
	configureAxis(jfreeChart.getXYPlot().getRangeAxis(), scatterPlot.getYAxisLabelFont(),
			scatterPlot.getYAxisLabelColor(), scatterPlot.getYAxisTickLabelFont(),
			scatterPlot.getYAxisTickLabelColor(), scatterPlot.getYAxisTickLabelMask(), scatterPlot.getYAxisVerticalTickLabels(),
			scatterPlot.getYAxisLineColor(), true,
			(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(scatterPlot.getRangeAxisMaxValueExpression()));

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:42,代码来源:DefaultChartTheme.java

示例15: createXyLineChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
protected JFreeChart createXyLineChart() throws JRException 
{
	JRLinePlot linePlot = (JRLinePlot) getPlot();

	ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
	JFreeChart jfreeChart = 
		ChartFactory.createXYLineChart(
			evaluateTextExpression(getChart().getTitleExpression()),
			evaluateTextExpression(linePlot.getCategoryAxisLabelExpression()),
			evaluateTextExpression(linePlot.getValueAxisLabelExpression() ),
			(XYDataset)getDataset(),
			linePlot.getOrientationValue().getOrientation(),
			isShowLegend(),
			true,
			false);

	configureChart(jfreeChart);

	// Handle the axis formating for the category axis
	configureAxis(jfreeChart.getXYPlot().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(jfreeChart.getXYPlot().getRangeAxis(), linePlot.getValueAxisLabelFont(),
			linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(),
			linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(),
			linePlot.getValueAxisLineColor(), true,
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()),
			(Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression()));

	XYLineAndShapeRenderer lineRenderer = (XYLineAndShapeRenderer) jfreeChart.getXYPlot().getRenderer();
	boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
	boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
	lineRenderer.setBaseShapesVisible(isShowShapes);
	lineRenderer.setBaseLinesVisible(isShowLines);

	return jfreeChart;
}
 
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:43,代码来源:DefaultChartTheme.java


注:本文中的org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setBaseLinesVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。