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


Java CategoryPlot.setDomainGridlinePaint方法代碼示例

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


在下文中一共展示了CategoryPlot.setDomainGridlinePaint方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: visualizarSerieChartAsignRescateVict

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
public void  visualizarSerieChartAsignRescateVict(Color color,CategoryDataset dataset) {
     ChartPanel chartPanel = new ChartPanel(chartNotifAsigResc);
     chartNotifAsigResc.setBackgroundPaint(Color.white);
    CategoryPlot plot = (CategoryPlot) chartNotifAsigResc.getPlot();
     plot.setBackgroundPaint(color);
     plot.setDataset(dataset);
     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);
     chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
   setContentPane(chartPanel);
   this.pack();
   RefineryUtilities.centerFrameOnScreen(this);
   this.setVisible(true);
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:21,代碼來源:VisualizacionJfreechart.java

示例2: visualizarSeriesTiemposRescateVictPorRobots

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
public void  visualizarSeriesTiemposRescateVictPorRobots(CategoryDataset dataset) {
    JFreeChart chart = ChartFactory.createBarChart(
     "Tiempos de Rescate de Victimas por cada robot ", // chart title
     "Robots en el entorno", // domain axis label
     "Tiempo milisegundos", // range axis label
     dataset, // data
     PlotOrientation.VERTICAL, // orientation
     true, // include legend
     true, // tooltips?
     false // URLs?
     );
     ChartPanel chartPanel = new ChartPanel(chart);
     chart.setBackgroundPaint(Color.white);
     CategoryPlot plot = chart.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);
     chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
     this.visualizar(chartPanel);
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:27,代碼來源:VisualizacionJfreechart.java

示例3: visualizarSeriesEnergRescateVictPorRobots

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
public void  visualizarSeriesEnergRescateVictPorRobots(CategoryDataset dataset) {
    JFreeChart chart = ChartFactory.createBarChart(
     "Tiempos de Rescate de Victimas por cada robot ", // chart title
     "Robots en el entorno", // domain axis label
     "Unidades de energ�a", // range axis label
     dataset, // data
     PlotOrientation.VERTICAL, // orientation
     true, // include legend
     true, // tooltips?
     false // URLs?
     );
     ChartPanel chartPanel = new ChartPanel(chart);
     chart.setBackgroundPaint(Color.white);
     CategoryPlot plot = chart.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);
     chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
     this.visualizar(chartPanel);
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:27,代碼來源:VisualizacionJfreechart.java

示例4: createChart

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
private JFreeChart createChart(CategoryDataset dataset, HttpServletRequest request) {
    JFreeChart chart = ChartFactory.createBarChart(null, null, null, dataset, PlotOrientation.HORIZONTAL, false, false, false);

    CategoryPlot plot = chart.getCategoryPlot();
    Paint background = new GradientPaint(0, 0, Color.lightGray, 0, IMAGE_MIN_HEIGHT, Color.white);
    plot.setBackgroundPaint(background);
    plot.setDomainGridlinePaint(Color.white);
    plot.setDomainGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.white);
    plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);

    LogarithmicAxis rangeAxis = new LogarithmicAxis(null);
    rangeAxis.setStrictValuesFlag(false);
    rangeAxis.setAllowNegativesFlag(true);
    plot.setRangeAxis(rangeAxis);

    // Disable bar outlines.
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);

    // Set up gradient paint for series.
    GradientPaint gp0 = new GradientPaint(
            0.0f, 0.0f, Color.blue,
            0.0f, 0.0f, new Color(0, 0, 64)
    );
    renderer.setSeriesPaint(0, gp0);

    // Rotate labels.
    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0));

    // Set theme-specific colors.
    Color bgColor = getBackground(request);
    Color fgColor = getForeground(request);

    chart.setBackgroundPaint(bgColor);

    domainAxis.setTickLabelPaint(fgColor);
    domainAxis.setTickMarkPaint(fgColor);
    domainAxis.setAxisLinePaint(fgColor);

    rangeAxis.setTickLabelPaint(fgColor);
    rangeAxis.setTickMarkPaint(fgColor);
    rangeAxis.setAxisLinePaint(fgColor);

    return chart;
}
 
開發者ID:airsonic,項目名稱:airsonic,代碼行數:48,代碼來源:UserChartController.java

示例5: crearBarChartCosteEnergiaRescateVictimas

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
public void crearBarChartCosteEnergiaRescateVictimas(CategoryDataset dataset) {
         JFreeChart chart = ChartFactory.createBarChart(
        "Energ�a consumida para salvar las victimas ", // chart title
        "Victimas ordenadas por tiempo de rescate", // domain axis label
        "Energ�a consumida", // range axis label
        dataset, // data
        PlotOrientation.VERTICAL, // orientation
        true, // include legend
        true, // tooltips?
        false // URLs?
        );
        ChartPanel chartPanel = new ChartPanel(chart);
        chart.setBackgroundPaint(Color.white);
        CategoryPlot plot = chart.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);
        chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
      setContentPane(chartPanel);
      this.pack();
      RefineryUtilities.centerFrameOnScreen(this);
      this.setVisible(true);
//        return chart;
            }
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:31,代碼來源:VisualizacionJfreechart.java

示例6: crearChartAsignRescateVict

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
public  JFreeChart crearChartAsignRescateVict(CategoryDataset dataset) {
       
       chartNotifAsigResc = ChartFactory.createLineChart(
          "Tiempos de Rescate de Victimas ",      // chart title Titulo local del grafico
          "Victimas Rescatadas  en Entorno",                      // 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,false);
        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);
        chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
      setContentPane(chartPanel);
      this.pack();
      RefineryUtilities.centerFrameOnScreen(this);
      this.setVisible(true);
      return chartNotifAsigResc;
    }
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:35,代碼來源:VisualizacionJfreechart.java

示例7: createChart

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
 * Creates a sample chart.
 * 
 * @param dataset  the dataset.
 * 
 * @return The chart.
 */
private static JFreeChart createChart(CategoryDataset dataset) {
    
    // create the chart...
    JFreeChart chart = ChartFactory.createBarChart(
        "Bar Chart Demo",         // chart title
        "Category",               // domain axis label
        "Value",                  // range axis label
        dataset,                  // data
        PlotOrientation.VERTICAL, // orientation
        true,                     // include legend
        true,                     // tooltips?
        false                     // URLs?
    );

    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...

    // set the background color for the chart...
    chart.setBackgroundPaint(Color.white);

    // get a reference to the plot for further customisation...
    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setDomainGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.white);

    // set the range axis to display integers only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    // disable bar outlines...
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);

    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(
        CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)
    );
    // OPTIONAL CUSTOMISATION COMPLETED.
    
    return chart;
    
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:51,代碼來源:SWTBarChartDemo1.java

示例8: createChart

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
 * Creates a sample chart.
 * 
 * @param dataset  the dataset.
 * 
 * @return The chart.
 */
private static JFreeChart createChart(CategoryDataset dataset) {
    
    // create the chart...
    JFreeChart chart = ChartFactory.createBarChart(
        "Bar Chart Demo 1",       // chart title
        "Category",               // domain axis label
        "Value",                  // range axis label
        dataset,                  // data
        PlotOrientation.VERTICAL, // orientation
        true,                     // include legend
        true,                     // tooltips?
        false                     // URLs?
    );

    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...

    // set the background color for the chart...
    chart.setBackgroundPaint(Color.white);

    // get a reference to the plot for further customisation...
    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setDomainGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.white);

    // ******************************************************************
    //  More than 150 demo applications are included with the JFreeChart
    //  Developer Guide...for more information, see:
    //
    //  >   http://www.object-refinery.com/jfreechart/guide.html
    //
    // ******************************************************************
    
    // set the range axis to display integers only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());

    // disable bar outlines...
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    
    // set up gradient paints for series...
    GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 
            0.0f, 0.0f, new Color(0, 0, 64));
    GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 
            0.0f, 0.0f, new Color(0, 64, 0));
    GradientPaint gp2 = new GradientPaint(0.0f, 0.0f, Color.red, 
            0.0f, 0.0f, new Color(64, 0, 0));
    renderer.setSeriesPaint(0, gp0);
    renderer.setSeriesPaint(1, gp1);
    renderer.setSeriesPaint(2, gp2);

    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(
            CategoryLabelPositions.createUpRotationLabelPositions(
                    Math.PI / 6.0));
    // OPTIONAL CUSTOMISATION COMPLETED.
    
    return chart;
    
}
 
開發者ID:parabuild-ci,項目名稱:parabuild-ci,代碼行數:70,代碼來源:BarChartDemo1.java

示例9: createChart

import org.jfree.chart.plot.CategoryPlot; //導入方法依賴的package包/類
/**
 * Creates a sample chart.
 * @param dataset  the dataset.
 * @return The chart.
 */
private JFreeChart createChart(CategoryDataset dataset) {
    // create the chart...
    JFreeChart chart = ChartFactory.createBarChart(
        "jaffa.sf.net 2005 Statistics",// chart title
        "Month",                  // domain axis label
        "Hits",                  // range axis label
        dataset,                  // data
        PlotOrientation.VERTICAL, // orientation
        true,                     // include legend
        true,                     // tooltips?
        false                     // URLs?
    );
 
    // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
 
    // set the background color for the chart...
    chart.setBackgroundPaint(Color.white);
 
    // get a reference to the plot for further customisation...
    CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setDomainGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.white);
 
    // set the range axis to display integers only...
    final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
 
    // disable bar outlines...
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
 
    // set up gradient paints for series...
    GradientPaint gp0 = new GradientPaint(
        0.0f, 0.0f, Color.blue,
        0.0f, 0.0f, new Color(0, 0, 64)
    );
    GradientPaint gp1 = new GradientPaint(
        0.0f, 0.0f, Color.green,
        0.0f, 0.0f, new Color(0, 64, 0)
    );
    GradientPaint gp2 = new GradientPaint(
        0.0f, 0.0f, Color.red,
        0.0f, 0.0f, new Color(64, 0, 0)
    );
    renderer.setSeriesPaint(0, gp0);
    renderer.setSeriesPaint(1, gp1);
    renderer.setSeriesPaint(2, gp2);
 
    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setCategoryLabelPositions(
        CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)
    );
    // OPTIONAL CUSTOMISATION COMPLETED.
 
    return chart;
}
 
開發者ID:jaffa-projects,項目名稱:jaffa-framework,代碼行數:64,代碼來源:ImageDom.java


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