當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。