org.jfree.chart.JFreeChart.getPlot()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.jfree.chart.JFreeChart.getPlot()方法的一些代码示例,展示了JFreeChart.getPlot()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFreeChart.getPlot()方法的具体详情如下:
包路径:org.jfree.chart.JFreeChart
类名称:JFreeChart
方法名:getPlot

JFreeChart.getPlot介绍

[英]Returns the plot for the chart. The plot is a class responsible for coordinating the visual representation of the data, including the axes (if any).
[中]返回图表的绘图。plot是一个类,负责协调数据的视觉表示,包括轴(如果有)。

代码示例

代码示例来源:origin: jenkinsci/jenkins

private BufferedImage render(StaplerRequest req, ChartRenderingInfo info) {
  String w = req.getParameter("width");
  if(w==null)     w=String.valueOf(defaultW);
  String h = req.getParameter("height");
  if(h==null)     h=String.valueOf(defaultH);
  Color graphBg = stringToColor(req.getParameter("graphBg"));
  Color plotBg = stringToColor(req.getParameter("plotBg"));
  if (graph==null)    graph = createGraph();
  graph.setBackgroundPaint(graphBg);
  Plot p = graph.getPlot();
  p.setBackgroundPaint(plotBg);
  return graph.createBufferedImage(Integer.parseInt(w),Integer.parseInt(h),info);
}

代码示例来源:origin: stackoverflow.com

PlotOrientation.VERTICAL, true, true, false);
Shape cross = ShapeUtilities.createDiagonalCross(3, 1);
XYPlot xyPlot = (XYPlot) jfreechart.getPlot();
xyPlot.setDomainCrosshairVisible(true);
xyPlot.setRangeCrosshairVisible(true);

代码示例来源:origin: pentaho/pentaho-kettle

false ); // urls       
chart.setBackgroundPaint( Color.white );
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setBackgroundPaint( Color.white );
plot.setForegroundAlpha( 0.5f );

代码示例来源:origin: stackoverflow.com

title, "X", "Y", createSampleData(),
  PlotOrientation.VERTICAL, true, true, false);
XYPlot xyPlot = (XYPlot) jfreechart.getPlot();
xyPlot.setDomainCrosshairVisible(true);
xyPlot.setRangeCrosshairVisible(true);

代码示例来源:origin: pentaho/pentaho-kettle

CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setBackgroundPaint( Color.white );
plot.setForegroundAlpha( 0.5f );

代码示例来源:origin: stackoverflow.com

PiePlot plot = (PiePlot) someChart.getPlot();
plot.setSectionPaint(KEY1, Color.green);
plot.setSectionPaint(KEY2, Color.red);

代码示例来源:origin: stackoverflow.com

// Create an XY Line chart
XYSeries series = new XYSeries("Random Data");
series.add(1.0, 500.2);
series.add(10.0, 694.1);
XYSeriesCollection data = new XYSeriesCollection(series);
JFreeChart chart = ChartFactory.createXYLineChart("XY Series Demo", "X", "Y", data,
                         PlotOrientation.VERTICAL, 
                         true, true, false);

// Create an NumberAxis
NumberAxis xAxis = new NumberAxis();
xAxis.setTickUnit(new NumberTickUnit(2));

// Assign it to the chart
XYPlot plot = (XYPlot) chart.getPlot();
plot.setDomainAxis(xAxis);

代码示例来源:origin: fossasia/neurolab-desktop

lineChart.getPlot().setOutlineStroke(new BasicStroke(3));
lineChart.getCategoryPlot().getRenderer().setSeriesStroke(0, new BasicStroke(3));
lineChart.getCategoryPlot().getRenderer().setSeriesStroke(1, new BasicStroke(3));

代码示例来源:origin: jfree/jfreechart

/**
 * Test that the chart is using an xy plot with time as the domain axis.
 *
 * @param chart  the chart.
 */
private void checkChart(JFreeChart chart) {
  Plot plot = chart.getPlot();
  if (!(plot instanceof PolarPlot)) {
    throw new IllegalArgumentException("plot is not a PolarPlot");
  }
}

代码示例来源:origin: stackoverflow.com

public class NoTransparencyCustomizer implements JRChartCustomizer{
  @Override
  public void customize(JFreeChart chart, JRChart jrchart) {
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setLabelShadowPaint(Color.GRAY);       
  }
}

代码示例来源:origin: ca.umontreal.iro/ssj

/**
* Sets the primary dataset for the plot, replacing the existing dataset if there is one.
* 
* @param dataset the new primary dataset.
* 
* 
*/
public void set (SSJXYSeriesCollection dataset)  {
 ((XYPlot)chart.getPlot()).setDataset(dataset.getSeriesCollection());
 ((XYPlot)chart.getPlot()).setRenderer(dataset.getRenderer());
 datasetList.set(0, dataset);
}

代码示例来源:origin: ca.umontreal.iro/ssj

protected void initAxis(){
 XAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getDomainAxis(),
          Axis.ORIENTATION_HORIZONTAL);
 YAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getRangeAxis(),
          Axis.ORIENTATION_VERTICAL);
 setAutoRange(true, true);
}

代码示例来源:origin: ca.umontreal.iro/ssj

protected void initAxis(){
 XAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getDomainAxis(),
          Axis.ORIENTATION_HORIZONTAL);
 YAxis = new Axis((NumberAxis)((XYPlot)chart.getPlot()).getRangeAxis(),
          Axis.ORIENTATION_VERTICAL);
 setAutoRange(true, true);
}

代码示例来源:origin: net.preibisch/multiview-reconstruction

public static int getChartXLocation( final Point point, final ChartPanel panel )
{
  final Point2D p = panel.translateScreenToJava2D( point );
  final Rectangle2D plotArea = panel.getScreenDataArea();
  final XYPlot plot = (XYPlot) panel.getChart().getPlot();
  final double chartX = plot.getDomainAxis().java2DToValue( p.getX(), plotArea, plot.getDomainAxisEdge() );
  //final double chartY = plot.getRangeAxis().java2DToValue( p.getY(), plotArea, plot.getRangeAxisEdge() );
  return (int)Math.round( chartX );
}

代码示例来源:origin: us.ihmc/Plotting

public static void addVerticalMarkerToXYPlot(ChartPanel chartPanel, double xValue)
{
 ValueMarker marker = new ValueMarker(xValue);
 marker.setPaint(Color.BLACK);
 
 XYPlot plot = (XYPlot) chartPanel.getChart().getPlot();
 plot.addDomainMarker(marker);
}

代码示例来源:origin: com.atlassian.jira/jira-api

public static void setDefaults(JFreeChart chart, final I18nHelper i18nHelper)
{
  chart.setBackgroundPaint(Color.WHITE);
  chart.setBorderVisible(false);
  chart.getPlot().setNoDataMessage(i18nHelper.getText("gadget.charts.no.data"));
  setupPlot(chart.getPlot());
  ChartUtil.setupTextTitle(chart.getTitle());
  ChartUtil.setupLegendTitle(chart.getLegend());
}

代码示例来源:origin: org.terracotta.modules/tim-ehcache-1.7-ui

protected void setupCachePutRatePanel(final XContainer parent) {
 cachePutRateSeries = createTimeSeries(bundle.getString("cache.put.rate"));
 JFreeChart chart = createChart(cachePutRateSeries, false);
 ChartPanel chartPanel = createChartPanel(chart);
 parent.add(chartPanel);
 chartPanel.setPreferredSize(fDefaultGraphSize);
 chartPanel.setBorder(new TitledBorder("Cache Put Rate"));
 chartPanel.setToolTipText("Cache Put Rate");
 chartPanel.setLayout(new BorderLayout());
 chartPanel.add(cachePutRateLabel = createOverlayLabel());
 ((XYPlot) chart.getPlot()).getRenderer().setSeriesPaint(0, EhcachePresentationUtils.PUT_FILL_COLOR);
}

代码示例来源:origin: com.atlassian.jira.ext.charting/jira-charting-plugin

private ChartHelper generateBarChart(CategoryDataset dataset, String chartTitle, String yLabel, String xLabel)
  {
    JFreeChart chart = org.jfree.chart.ChartFactory.createBarChart(chartTitle, yLabel, xLabel, dataset, PlotOrientation.VERTICAL, false, false, false);
    BarRenderer renderer = (BarRenderer) ((CategoryPlot) chart.getPlot()).getRenderer();
    renderer.setBarPainter(new StandardBarPainter());
    renderer.setShadowVisible(false);

    return new ChartHelper(chart);
  }
}

代码示例来源:origin: org.jvnet.its/issuetracker-stats

protected JFreeChart createChart(XYDataset dataset) {
    JFreeChart jfreechart = ChartFactory.createTimeSeriesChart(
      null, "time", "# of issues", dataset, true, false, false);
    jfreechart.setBackgroundPaint(Color.WHITE);

    XYPlot plot = (XYPlot)jfreechart.getPlot();
    XYStepAreaRenderer renderer = new XYStepAreaRenderer();
    plot.setRenderer(renderer);
    renderer.setSeriesPaint(0,ColorPalette.RED);
    renderer.setSeriesPaint(1,ColorPalette.GREEN);

    return jfreechart;
  }
}

代码示例来源:origin: org.openfuxml/ofx-chart

@Override
protected void setSpecialGrid()
{
  XYPlot plot = (XYPlot) chart.getPlot();
  Grid grid = ofxChart.getGrid();
  if(grid.isSetDomain()){plot.setDomainGridlinesVisible(grid.isDomain());}
  if(grid.isSetRange()){plot.setRangeGridlinesVisible(grid.isRange());}
}

相关文章