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


Java LineAndShapeRenderer.setUseFillPaint方法代码示例

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


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

示例1: crearLineChartAsignRescateVict

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
public  JFreeChart crearLineChartAsignRescateVict(CategoryDataset dataset) {
       
       chartNotifAsigResc = ChartFactory.createLineChart(
          "Tiempos de Notificaci�n, asiganci�n y Rescate de Victimas ",      // chart title Titulo local del grafico
          "Victimas Ordenadas por tiempo de rescate ",                      // x axis label
          "Tiempo milisegundos",                      // y axis label
          dataset,                  // data
          PlotOrientation.VERTICAL,
          true,                     // include legend
          true,                     // tooltips
          false                     // urls
      );

      // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
      ChartPanel chartPanel = new ChartPanel(chartNotifAsigResc);
//        chartNotifAsigResc.setBackgroundPaint(Color.white);
       CategoryPlot plot = (CategoryPlot) chartNotifAsigResc.getPlot();
//        CategoryPlot plot = chartNotifAsigResc.getCategoryPlot();
//        plot.setBackgroundPaint(Color.lightGray);
//        plot.setDomainGridlinePaint(Color.white);
//        plot.setRangeGridlinePaint(Color.white);
//        NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
//        rangeAxis.setUpperMargin(0.15);
        CategoryItemRenderer renderer = plot.getRenderer();
        renderer.setItemLabelGenerator(new LabelGenerator(50.0));
        renderer.setItemLabelFont(new Font("Serif", Font.PLAIN, 8));
        renderer.setItemLabelsVisible(true);
//      CategoryPlot plot = (CategoryPlot) chartNotifAsigResc.getPlot();
            LineAndShapeRenderer rendererl = (LineAndShapeRenderer) plot.getRenderer();
            rendererl.setShapesVisible(true);
            rendererl.setDrawOutlines(true);
            rendererl.setUseFillPaint(true);
            rendererl.setFillPaint(Color.white);
        chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
      setContentPane(chartPanel);
      this.pack();
      RefineryUtilities.centerFrameOnScreen(this);
      this.setVisible(true);
      return chartNotifAsigResc;
    }
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:41,代码来源:VisualizacionJfreechart.java

示例2: setPlotStyle

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
private void setPlotStyle(JFreeChart chart) throws ChartException {
if (chart == null)
	throw new ChartException("chart未正确创建,设置图表样式时异常!");
// 获得线性图的Plot对象
   CategoryPlot localCategoryPlot = (CategoryPlot)chart.getPlot();
   localCategoryPlot.setBackgroundAlpha(this.getAlpha());
   
   BasicStroke stroke = new BasicStroke();
   localCategoryPlot.setRangeGridlinesVisible(true) ;//数据轴网格是否可见
   localCategoryPlot.setRangeGridlinePaint(Color.black)   ;//数据轴网格线条颜色
   //localCategoryPlot.setRangeGridlineStroke(stroke) ;//数据轴网格线条笔触

   //localCategoryPlot.setDomainGridlinesVisible(true) ;//数据轴网格是否可见
   //localCategoryPlot.setDomainGridlinePaint(Color.black)   ;//数据轴网格线条颜色
   //localCategoryPlot.setDomainGridlineStroke(stroke);
   CategoryAxis localCategoryXAxis = (CategoryAxis)localCategoryPlot.getDomainAxis();
   NumberAxis localNumberYAxis = (NumberAxis)localCategoryPlot.getRangeAxis();
   localCategoryXAxis.setTickLabelFont(new Font("宋体", Font.PLAIN, 12));
   localCategoryXAxis.setLabelFont(new Font("宋体", Font.PLAIN, 12));
   localNumberYAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
   localNumberYAxis.setTickLabelFont(new Font("宋体", Font.PLAIN, 12));
   localNumberYAxis.setLabelFont(new Font("宋体", Font.PLAIN, 12));
   
   LineAndShapeRenderer localLineAndShapeRenderer = (LineAndShapeRenderer)localCategoryPlot.getRenderer();
   //localLineAndShapeRenderer.setDrawLines(true);//    是否折线的数据点之间用线连
   //localLineAndShapeRenderer.setDrawShapes(true);//   是否折线的数据点根据分类使用不同的形状
   localLineAndShapeRenderer.setStroke(new BasicStroke(this.getStrok()));//这个是设置线条的粗细
   
   if("1".equals(this.getDisplayNumber())){
   localLineAndShapeRenderer.setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());//折线上显示数字
   localLineAndShapeRenderer.setBaseItemLabelsVisible(true);
   }

   localLineAndShapeRenderer.setBaseShapesVisible(true);
   localLineAndShapeRenderer.setBaseShapesFilled(true);
   localLineAndShapeRenderer.setDrawOutlines(true);
   localLineAndShapeRenderer.setUseFillPaint(true);
   localLineAndShapeRenderer.setBaseFillPaint(Color.white);	
   }
 
开发者ID:fanqinghui,项目名称:TaskExcute,代码行数:40,代码来源:LineCharts.java

示例3: createChart

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
/**
   * Creates a sample chart.
   * 
   * @param dataset  a dataset.
   * 
   * @return The chart.
   */
  protected JFreeChart createChart(CategoryDataset dataset) {
      
      // create the chart...
      JFreeChart chart = ChartFactory.createLineChart(
          chartTitle,   // chart title
          domainLabel,                       // domain axis label
          rangeLabel,                   // range axis label
          dataset,                         // data
          PlotOrientation.VERTICAL,        // orientation
          !legendPanelOn,                           // 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();
      renderer.setBaseShapesVisible(true);
      renderer.setDrawOutlines(true);
      renderer.setUseFillPaint(true);
      renderer.setBaseFillPaint(Color.white);
      renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());

setCategorySummary(dataset);
      return chart;
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:45,代码来源:LineChartDemo1a.java

示例4: createChart

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
/**
   * Creates a sample chart.
   * 
   * @param dataset  a dataset.
   * 
   * @return The chart.
   */
  protected JFreeChart createChart(CategoryDataset dataset) {
      
      // create the chart...
      JFreeChart chart = ChartFactory.createLineChart(
          chartTitle,   // chart title
          domainLabel,                       // domain axis label
          rangeLabel,                   // range axis label
          dataset,                         // data
          PlotOrientation.VERTICAL,        // orientation
          !legendPanelOn,                           // 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();
      renderer.setBaseShapesVisible(true);
      renderer.setDrawOutlines(true);
      renderer.setUseFillPaint(true);
      renderer.setBaseFillPaint(Color.white);
      renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());

setCategorySummary(dataset);
      return chart;
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:44,代码来源:LineChartDemo1b.java

示例5: formatSeries

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
protected void formatSeries(LineAndShapeRenderer renderer) {
    renderer.setBaseShapesVisible(true);
    renderer.setDrawOutlines(true);
    renderer.setUseFillPaint(true);
    renderer.setBaseStroke(new BasicStroke(2));
    
    int count = ((CategoryDataset) dataset).getRowCount();
    ColorGenerator colors = format.getColors();
    for(int i=0; i<count; i++) {
        Paint color = colors.nextColor();
        renderer.setSeriesPaint(i, color);
        renderer.setSeriesFillPaint(i, color);
    }
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:15,代码来源:AbstractLineChart.java

示例6: formatSeries

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
protected void formatSeries(LineAndShapeRenderer renderer) {
    renderer.setBaseShapesVisible(true);
    renderer.setDrawOutlines(true);
    renderer.setUseFillPaint(true);
    renderer.setBaseStroke(new BasicStroke(2));
    
    int count = ((CategoryDataset) dataset).getRowCount();
    ColorGenerator colors = format.getColors();
    for(int i=0; i<count; i++) {
        Color color = colors.nextColor();
        renderer.setSeriesPaint(i, color);
        renderer.setSeriesFillPaint(i, color);
    }
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:15,代码来源:AbstractLineChart.java

示例7: linePlt

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
public linePlt(String title, String x_title, String y_title, String Categories) throws Exception{
    super("");
   DefaultCategoryDataset dataset = new DefaultCategoryDataset();
   String[] ct = Categories.split(";");
    for(String bf: ct){
      //  if(bf.startsWith("("))
          //  bf=bf.substring(1);
       // if(bf.endsWith(")"))
          //  bf=bf.substring(0,bf.length()-1);
     dataset.addValue(new Double(jc.eval("2dbl("+jc.eval(bf.substring(0,bf.indexOf(',')))+")")),
                              bf.substring(bf.indexOf(',')+1,bf.lastIndexOf(',')),
                              bf.substring(bf.lastIndexOf(',')+1));
    }
    if(title==null)
      title = "Line Chart";
    if(y_title == null)
       y_title = "y";
    if(x_title == null)
        x_title="x";
    
      chart = ChartFactory.createLineChart(
                           title,
                           x_title,
                           y_title,
                           dataset,
                           PlotOrientation.VERTICAL, // orientation
                           false,                     // include legend
                           true,                     // tooltips?
                           false                     // URLs?
                    );
     chart.setBackgroundPaint(Color.white);
     LineAndShapeRenderer renderer = (LineAndShapeRenderer)( (CategoryPlot)chart.getPlot()).getRenderer(); 
     renderer.setShapesVisible(true);
     renderer.setDrawOutlines(true);
     renderer.setUseFillPaint(true);
     renderer.setFillPaint(Color.white);

     
     /*
     if(space!=null){
         BarRenderer renderer = (BarRenderer) ((CategoryPlot)chart.getPlot()).getRenderer();
          renderer.setItemMargin(new Double(space));
     }
     */

    
}
 
开发者ID:mathhobbit,项目名称:EditCalculateAndChart,代码行数:48,代码来源:linePlt.java

示例8: createChart

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //导入方法依赖的package包/类
/**
   * Creates a sample chart.
   * 
   * @param dataset  a dataset.
   * 
   * @return The chart.
   */
  protected JFreeChart createChart(CategoryDataset dataset) {
  	 if(isDemo){
  		 chartTitle = "Java Standard Class Library";
  		 domainLabel = "Release";
  		 rangeLabel ="Class Count";
  	 }else chartTitle="Line Chart";
  	 
  	
      // create the chart...
      JFreeChart chart = ChartFactory.createLineChart(
          chartTitle,   // chart title
          domainLabel,                       // domain axis label
          rangeLabel,                   // range axis label
          dataset,                         // data
          PlotOrientation.VERTICAL,        // orientation
          !legendPanelOn,                           // include legend
          true,                            // tooltips
          false                            // urls
      );

      if(isDemo){
       chart.addSubtitle(new TextTitle("Number of Classes By Release"));
       TextTitle source = new TextTitle(
           "Source: Java In A Nutshell (4th Edition) " 
           + "by David Flanagan (O'Reilly)"
       );
       source.setFont(new Font("SansSerif", Font.PLAIN, 10));
       source.setPosition(RectangleEdge.BOTTOM);
       source.setHorizontalAlignment(HorizontalAlignment.RIGHT);
       chart.addSubtitle(source);
      }else{
      	chart.clearSubtitles();
      }
      
      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();
      renderer.setBaseShapesVisible(true);
      renderer.setDrawOutlines(true);
      renderer.setUseFillPaint(true);
      renderer.setBaseFillPaint(Color.white);
      renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());

setCategorySummary(dataset);
      return chart;
  }
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:64,代码来源:LineChartDemo1.java

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

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

        ColorGenerator colors = new DefaultColorGenerator();
        int count = dataSet.getRowCount();
        
        int r = 3;
        Shape circle = new Ellipse2D.Float(-r, -r, 2*r, 2*r);
        for(int i=0; i<count; i++) {
            Paint color = colors.nextColor();
            lasr.setSeriesPaint(i, color);
            lasr.setSeriesFillPaint(i, color);
            lasr.setSeriesShape(i, circle);
        }
    
    }
    
    return new ChartPanel(chart);
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:44,代码来源:AccidentFactorPlot.java

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