org.jfree.chart.plot.Plot.draw()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(112)

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

Plot.draw介绍

[英]Draws the plot within the specified area. The anchor is a point on the chart that is specified externally (for instance, it may be the last point of the last mouse click performed by the user) - plots can use or ignore this value as they see fit.

Subclasses need to provide an implementation of this method, obviously.
[中]在指定区域内绘制绘图。定位点是图表上外部指定的一个点(例如,它可能是用户最后一次单击鼠标的最后一个点)——绘图可以根据需要使用或忽略该值。
显然,子类需要提供这种方法的实现。

代码示例

代码示例来源:origin: org.n52.sensorweb/oxf-layer

/**
 * The resulting IVisualization shows a chart which consists a TimeSeries for each FeatureOfInterest
 * contained in the observationCollection.
 */
public IVisualization renderChart(OXFFeatureCollection observationCollection,
                 ParameterContainer paramCon,
                 int width,
                 int height) {
  JFreeChart chart = renderChart(observationCollection, paramCon);
  Plot plot = chart.getPlot();
  // draw plot into image:
  BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
  Graphics2D g = image.createGraphics();
  g.setColor(Color.white);
  g.fillRect(0, 0, width, height);
  plot.draw(g, new Rectangle2D.Float(0, 0, width, height), null, null, null);
  return new StaticVisualization(image);
}

代码示例来源:origin: org.n52.sensorweb/oxf-layer

/**
 * The resulting IVisualization shows a scatterplot.
 * 
 * Auf X- und Y-Achse wird jeweils eine observedProperty abgetragen.
 * 
 * Ein Punkt steht dann f�r ein Wertepaar (X,Y) f�r ein FOI zu einem bestimmten Zeitpunkt.
 * 
 * TODO PROBLEM: Macht nur Sinn, wenn f�r jedes (FOI, Time)-Tuple jeweils ein Wert f�r BEIDE
 * observedPropertys enthalten ist !!!!
 */
public IVisualization renderChart(OXFFeatureCollection observationCollection,
                 ParameterContainer paramCon,
                 int width,
                 int height) {
  JFreeChart chart = renderChart(observationCollection, paramCon);
  Plot plot = chart.getPlot();
  // draw plot into image:
  BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
  Graphics2D g = image.createGraphics();
  plot.draw(g, new Rectangle2D.Float(0, 0, width, height), null, null, null);
  return new StaticVisualization(image);
}

代码示例来源:origin: org.n52.sensorweb/oxf-layer

/**
 * The resulting IVisualization shows a chart which consists a TimeSeries for each FeatureOfInterest
 * contained in the observationCollection.
 */
public IVisualization renderChart(OXFFeatureCollection observationCollection,
                 ParameterContainer paramCon,
                 int width,
                 int height) {
  JFreeChart chart = renderChart(observationCollection, paramCon);
  // draw plot into image:
  Plot plot = chart.getPlot();
  BufferedImage chartImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
  Graphics2D chartGraphics = chartImage.createGraphics();
  chartGraphics.setColor(Color.white);
  chartGraphics.fillRect(0, 0, width, height);
  plot.draw(chartGraphics, new Rectangle2D.Float(0, 0, width, height), null, null, null);
  // draw legend into image:
  LegendTitle legend = chart.getLegend();
  BufferedImage legendImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
  Graphics2D legendGraphics = legendImage.createGraphics();
  legendGraphics.setColor(Color.white);
  legendGraphics.fillRect(0, 0, (int) legend.getWidth(), (int) legend.getHeight());
  legend.draw(legendGraphics, new Rectangle2D.Float(0, 0, width, height));
  return new StaticVisualization(chartImage, legendImage);
}

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

plotInfo = info.getPlotInfo();
this.plot.draw(g2, plotArea, anchor, null, plotInfo);
g2.setClip(savedClip);
if (this.elementHinting) {

代码示例来源:origin: org.codehaus.jtstand/jtstand-chart

plotInfo = info.getPlotInfo();
this.plot.draw(g2, plotArea, anchor, null, plotInfo);

相关文章