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


Java XYLineAndShapeRenderer.setUseFillPaint方法代码示例

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


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

示例1: addSerie

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public void addSerie(int indexSerie, Color color, XYSeries localXYSeries){    	
        XYSeriesCollection localXYSeriesCollection = new XYSeriesCollection();
        localXYSeriesCollection.addSeries(localXYSeries);     //Se aniade la serie

        Ellipse2D.Double localDouble = new Ellipse2D.Double(-4.0D, -4.0D, 8.0D, 8.0D); //Forma de la anotacion del punto x,y
        
        XYLineAndShapeRenderer localXYLineAndShapeRenderer = new XYLineAndShapeRenderer();

        localXYLineAndShapeRenderer.setSeriesLinesVisible(indexSerie,true);        //provoca que se pinten lineas rectas que unen los puntos x,y que conforman la serie
        localXYLineAndShapeRenderer.setSeriesShapesVisible(indexSerie,false);       //provoca que se pinte la forma asociada al punto x,y       

        plot.setDataset(indexSerie, localXYSeriesCollection);  //Se aniade la serie al plot
        plot.setRenderer(indexSerie, localXYLineAndShapeRenderer);

        localXYLineAndShapeRenderer.setSeriesShape(indexSerie, new Ellipse2D.Double(-4.0, -4.0, 8.0, 8.0));
        
//        localXYLineAndShapeRenderer.setSeriesShape(indexSerie, localDouble);
        
        
        localXYLineAndShapeRenderer.setSeriesPaint(indexSerie, color);
        //localXYLineAndShapeRenderer.setSeriesFillPaint(indexSerie, Color.yellow);
        //localXYLineAndShapeRenderer.setSeriesOutlinePaint(indexSerie, Color.gray);
        localXYLineAndShapeRenderer.setUseFillPaint(false);//true
        localXYLineAndShapeRenderer.setUseOutlinePaint(false);//true
        localXYLineAndShapeRenderer.setDrawOutlines(false);
        localXYLineAndShapeRenderer.setDrawSeriesLineAsPath(true);                       
    }
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:28,代码来源:VisualizacionJfreechart.java

示例2: addSerie

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public void addSerie(int indexSerie, Color color, XYSeries localXYSeries){ 
        XYPlot plot=null;
        XYSeriesCollection localXYSeriesCollection = new XYSeriesCollection();
        localXYSeriesCollection.addSeries(localXYSeries);     //Se aniade la serie

        Ellipse2D.Double localDouble = new Ellipse2D.Double(-4.0D, -4.0D, 8.0D, 8.0D); //Forma de la anotacion del punto x,y
        
        XYLineAndShapeRenderer localXYLineAndShapeRenderer = new XYLineAndShapeRenderer();

        localXYLineAndShapeRenderer.setSeriesLinesVisible(indexSerie,true);        //provoca que se pinten lineas rectas que unen los puntos x,y que conforman la serie
        localXYLineAndShapeRenderer.setSeriesShapesVisible(indexSerie,false);       //provoca que se pinte la forma asociada al punto x,y       

        plot.setDataset(indexSerie, localXYSeriesCollection);  //Se aniade la serie al plot
        plot.setRenderer(indexSerie, localXYLineAndShapeRenderer);

        localXYLineAndShapeRenderer.setSeriesShape(indexSerie, new Ellipse2D.Double(-4.0, -4.0, 8.0, 8.0));
        
//        localXYLineAndShapeRenderer.setSeriesShape(indexSerie, localDouble);
        
        
        localXYLineAndShapeRenderer.setSeriesPaint(indexSerie, color);
        //localXYLineAndShapeRenderer.setSeriesFillPaint(indexSerie, Color.yellow);
        //localXYLineAndShapeRenderer.setSeriesOutlinePaint(indexSerie, Color.gray);
        localXYLineAndShapeRenderer.setUseFillPaint(false);//true
        localXYLineAndShapeRenderer.setUseOutlinePaint(false);//true
        localXYLineAndShapeRenderer.setDrawOutlines(false);
        localXYLineAndShapeRenderer.setDrawSeriesLineAsPath(true);                       
    }
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:29,代码来源:VisualizacionJfreechart.java

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

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

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

示例6: createLineChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public static JFreeChart createLineChart(String chartTitle, String chartXdesc, String chartYdesc,
                                             String periodType, int dateInterval, String timeFormat, XYDataset dataSet) {
        JFreeChart chart = ChartFactory.createTimeSeriesChart(
                chartTitle, chartXdesc, chartYdesc, dataSet, true, false, false
        );
        StandardChartTheme chartTheme = new StandardChartTheme("CN");
        ChartFactory.setChartTheme(chartTheme);
//设置标题
        chart.setTitle(new TextTitle(chartTitle, new Font(/*"黑体"*/fontsName, Font.ITALIC, 22)));
        LegendTitle legend = chart.getLegend();
        legend.setItemFont(new Font(fontsName, Font.BOLD, 12)); // 设置图例的字体,防止中文乱z码
        XYPlot xyplot = chart.getXYPlot();
//    xyplot.setBackgroundPaint(new Color(250, 250,250));
        xyplot.setBackgroundPaint(Color.white);
//    xyplot.setForegroundAlpha(0.65F); // 设置前景色透明度
        xyplot.setForegroundAlpha(1.0F); // 设置前景色透明度
        // 设置横虚线可见
        xyplot.setRangeGridlinesVisible(true);
        // 虚线色彩
        xyplot.setRangeGridlinePaint(Color.gray);
        xyplot.getRangeAxis().setLabelFont(new Font(fontsName, Font.BOLD, 12)); // Y轴设置字体,防止中文乱码
        xyplot.getDomainAxis().setLabelFont(new Font(fontsName, Font.BOLD, 12)); // X轴设置字体,防止中文乱码

        //边框 不显示
        xyplot.setOutlineVisible(false);

        //获得 renderer 注意这里是XYLineAndShapeRenderer !!
        XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
        xylineandshaperenderer.setShapesVisible(true); //数据点可见
        xylineandshaperenderer.setShapesFilled(true); //数据点被填充即不是空心点
        xylineandshaperenderer.setSeriesFillPaint(0, Color.GREEN); //数据点填充为红色
        xylineandshaperenderer.setSeriesPaint(0, Color.GREEN); //折线为绿色


        xylineandshaperenderer.setUseFillPaint(true); //应用

        ////设置Y轴间隔
        NumberAxis numAxis = (NumberAxis) xyplot.getRangeAxis();
        numAxis.setTickUnit(new NumberTickUnit(1));

        //边框是否显示


        //设置X轴间隔
        DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis();
        if (periodType.equalsIgnoreCase("MONTH")) {
            dateaxis.setTickUnit(new DateTickUnit(DateTickUnitType.MONTH, dateInterval));
        } else if (periodType.equalsIgnoreCase("DAY")) {
            dateaxis.setTickUnit(new DateTickUnit(DateTickUnitType.DAY, dateInterval));
        } else if (periodType.equalsIgnoreCase("HOUR")) {
            dateaxis.setTickUnit(new DateTickUnit(DateTickUnitType.HOUR, dateInterval));
        }
        dateaxis.setDateFormatOverride(new SimpleDateFormat(timeFormat));
        return chart;
    }
 
开发者ID:glameyzhou,项目名称:scaffold,代码行数:56,代码来源:JFreeChartFactory.java

示例7: createLineChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private JFreeChart createLineChart(String title, String xLabel, String yLabel, XYDataset dataset, String other) {
      
 
      // create the chart...
      JFreeChart chart = ChartFactory.createXYLineChart(
          title,   // chart title
          xLabel,                     // domain axis label
          yLabel,                   // range axis label
          dataset,                         // data
          PlotOrientation.VERTICAL,        // orientation
          false,                           // include legend
          true,                            // tooltips
          false                            // urls
      );

      chart.setBackgroundPaint(Color.white);

      XYPlot plot = chart.getXYPlot();
      plot.setBackgroundPaint(Color.lightGray);
      plot.setRangeGridlinePaint(Color.white);
      plot.setDomainGridlinePaint(Color.white);
      //plot.setNoDataMessage("No data available");

      // customise the range axis...

      NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
//rangeAxis.setAutoRange(false);	
      rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
      NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
   // domainAxis.setAutoRange(false);	
      domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

      // customise the renderer...
      XYLineAndShapeRenderer renderer 
          = (XYLineAndShapeRenderer) plot.getRenderer();
      renderer.setBaseShapesVisible(true);
      renderer.setBaseLinesVisible(false);
      renderer.setDrawOutlines(true);
      renderer.setBaseShapesFilled(true);
renderer.setUseFillPaint(true);
//renderer.setFillPaint(Color.white);
     
if (other.toLowerCase().indexOf("noshape")!=-1){
	renderer.setBaseShapesVisible(false);
       renderer.setBaseLinesVisible(true);
}

if (other.toLowerCase().indexOf("excludeszero")!=-1){
	rangeAxis.setAutoRangeIncludesZero(false);
	domainAxis.setAutoRangeIncludesZero(false);
}
  	   
  	   
      return chart;
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:56,代码来源:ChartGenerator.java

示例8: createLineChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private JFreeChart createLineChart(String title, String xLabel, String yLabel, XYDataset dataset, String other) {


        // create the chart...
        JFreeChart chart = ChartFactory.createXYLineChart(
            title,   // chart title
            xLabel,                     // domain axis label
            yLabel,                   // range axis label
            dataset,                         // data
            PlotOrientation.VERTICAL,        // orientation
            true,                           // include legend
            true,                            // tooltips
            false                            // urls
        );



        XYPlot plot = chart.getXYPlot();
        chart.setBackgroundPaint(Color.white);
        plot.setRangeGridlinePaint(Color.lightGray);
        plot.setDomainGridlinePaint(Color.lightGray);
        //plot.setNoDataMessage("No data available");

        // customise the range axis...

        NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
        rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
        NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
        domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
        rangeAxis.setUpperMargin(0.02);
        rangeAxis.setLowerMargin(0.02);
        domainAxis.setUpperMargin(0.02);
        domainAxis.setLowerMargin(0.02);


        // customise the renderer...
        XYLineAndShapeRenderer renderer
            = (XYLineAndShapeRenderer) plot.getRenderer();
        renderer.setBaseShapesVisible(true);
        renderer.setBaseLinesVisible(true);
        renderer.setDrawOutlines(true);
        renderer.setBaseShapesFilled(true);
		renderer.setUseFillPaint(true);
		renderer.setBaseFillPaint(Color.white);

		if (other.toLowerCase().indexOf("noline")!=-1){
			renderer.setBaseShapesVisible(true);
	        renderer.setBaseLinesVisible(false);
		}

		if (other.toLowerCase().indexOf("noshape")!=-1){
			renderer.setBaseShapesVisible(false);
	        renderer.setBaseLinesVisible(true);
		}

		if (other.toLowerCase().indexOf("excludeszero")!=-1){
			rangeAxis.setAutoRangeIncludesZero(false);
			domainAxis.setAutoRangeIncludesZero(false);
		}

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


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