gpt4 book ai didi

org.jfree.chart.renderer.xy.XYSplineRenderer类的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 14:06:40 27 4
gpt4 key购买 nike

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

XYSplineRenderer介绍

[英]A renderer that connects data points with natural cubic splines and/or draws shapes at each data point. This renderer is designed for use with the XYPlot class. The example shown here is generated by the XYSplineRendererDemo1.java program included in the JFreeChart demo collection:
[中]将数据点与自然三次样条曲线连接和/或在每个数据点绘制形状的渲染器。此渲染器设计用于XYPlot类。这里显示的示例是由xysplinerderdemo1生成的。JFreeChart演示集合中包含的java程序:

代码示例

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

/**
 * Sets the gradient paint transformer and sends a 
 * {@link RendererChangeEvent} to all registered listeners.
 * 
 * @param gpt  the transformer ({@code null} permitted).
 * 
 * @since 1.0.17
 */
public void setGradientPaintTransformer(GradientPaintTransformer gpt) {
  this.gradientPaintTransformer = gpt;
  fireChangeEvent();
}

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

public Paint getSeriesPaint(int series)
{
  if(ofxPaintColors!=null)
  {
    return ofxPaintColors.getSeriesPaint(series);
  }
  else
  {
    return super.getSeriesPaint(series);
  }
}

代码示例来源:origin: Kurento/kurento-java

public void drawChart(String filename, int width, int height) throws IOException {
 // Create plot
 NumberAxis xAxis = new NumberAxis(xAxisLabel);
 NumberAxis yAxis = new NumberAxis(yAxisLabel);
 XYSplineRenderer renderer = new XYSplineRenderer();
 XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
 plot.setBackgroundPaint(Color.lightGray);
 plot.setDomainGridlinePaint(Color.white);
 plot.setRangeGridlinePaint(Color.white);
 plot.setAxisOffset(new RectangleInsets(4, 4, 4, 4));
 // Create chart
 JFreeChart chart = new JFreeChart(chartTitle, JFreeChart.DEFAULT_TITLE_FONT, plot, true);
 ChartUtilities.applyCurrentTheme(chart);
 ChartPanel chartPanel = new ChartPanel(chart, false);
 // Draw png
 BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
 Graphics graphics = bi.getGraphics();
 chartPanel.setBounds(0, 0, width, height);
 chartPanel.paint(graphics);
 ImageIO.write(bi, "png", new File(filename));
}

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

- (d[i] - d[i - 1]) / h[i];
  solveTridiag(sub, diag, sup, a, np - 2);
  Paint fp = getSeriesFillPaint(series);
  if (this.gradientPaintTransformer != null 
      && fp instanceof GradientPaint) {
drawFirstPassShape(g2, pass, series, item, s.seriesPath);

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

- (d[i] - d[i - 1]) / h[i];
  solveTridiag(sub, diag, sup, a, np - 2);
drawFirstPassShape(g2, pass, series, item, s.seriesPath);

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

/**
 * Initialises the renderer.
 * <P>
 * This method will be called before the first item is rendered, giving the
 * renderer an opportunity to initialise any state information it wants to
 * maintain.  The renderer can do nothing if it chooses.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @param plot  the plot.
 * @param data  the data.
 * @param info  an optional info collection object to return data back to
 *              the caller.
 *
 * @return The renderer state.
 */
public XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea,
    XYPlot plot, XYDataset data, PlotRenderingInfo info) {
  State state = (State) super.initialise(g2, dataArea, plot, data, info);
  state.setProcessVisibleItemsOnly(false);
  this.points = new Vector();
  setDrawSeriesLineAsPath(true);
  return state;
}

代码示例来源:origin: org.kurento/kurento-test

public void drawChart(String filename, int width, int height) throws IOException {
 // Create plot
 NumberAxis xAxis = new NumberAxis(xAxisLabel);
 NumberAxis yAxis = new NumberAxis(yAxisLabel);
 XYSplineRenderer renderer = new XYSplineRenderer();
 XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
 plot.setBackgroundPaint(Color.lightGray);
 plot.setDomainGridlinePaint(Color.white);
 plot.setRangeGridlinePaint(Color.white);
 plot.setAxisOffset(new RectangleInsets(4, 4, 4, 4));
 // Create chart
 JFreeChart chart = new JFreeChart(chartTitle, JFreeChart.DEFAULT_TITLE_FONT, plot, true);
 ChartUtilities.applyCurrentTheme(chart);
 ChartPanel chartPanel = new ChartPanel(chart, false);
 // Draw png
 BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_BGR);
 Graphics graphics = bi.getGraphics();
 chartPanel.setBounds(0, 0, width, height);
 chartPanel.paint(graphics);
 ImageIO.write(bi, "png", new File(filename));
}

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

/**
 * Initialises the renderer.
 * <P>
 * This method will be called before the first item is rendered, giving the
 * renderer an opportunity to initialise any state information it wants to
 * maintain.  The renderer can do nothing if it chooses.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area inside the axes.
 * @param plot  the plot.
 * @param data  the data.
 * @param info  an optional info collection object to return data back to
 *              the caller.
 *
 * @return The renderer state.
 */
@Override
public XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea,
    XYPlot plot, XYDataset data, PlotRenderingInfo info) {
  setDrawSeriesLineAsPath(true);
  XYSplineState state = new XYSplineState(info);
  state.setProcessVisibleItemsOnly(false);
  return state;
}

代码示例来源:origin: de.tudarmstadt.ukp.dkpro.tc/de.tudarmstadt.ukp.dkpro.tc.weka-gpl

@Override
  public void write(OutputStream aStream)
    throws IOException
  {
    JFreeChart chart = ChartFactory.createXYLineChart(null, "Recall", "Precision", dataset,
        PlotOrientation.VERTICAL, false, false, false);
    chart.getXYPlot().setRenderer(new XYSplineRenderer());
    chart.getXYPlot().getRangeAxis().setRange(0.0, 1.0);
    chart.getXYPlot().getDomainAxis().setRange(0.0, 1.0);
    ChartUtil.writeChartAsSVG(aStream, chart, 400, 400);
  }
}

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

/**
 * Set the fill type and sends a {@link RendererChangeEvent}
 * to all registered listeners.
 *
 * @param fillType   the fill type ({@code null} not permitted).
 *
 * @see #getFillType()
 * 
 * @since 1.0.17
 */
public void setFillType(FillType fillType) {
  this.fillType = fillType;
  fireChangeEvent();
}

代码示例来源:origin: de.tudarmstadt.ukp.inception.app/inception-imls-core

private static JFreeChart plotChart(List<ExtendedResult> results)
{
  double[][] dataFScore = new double[2][results.size()];
  double[][] dataPrecision = new double[2][results.size()];
  double[][] dataRecall = new double[2][results.size()];
  for (int i = 0; i < results.size(); i++) {
    ExtendedResult r = results.get(i);
    dataFScore[0][i] = r.getIterationNumber();
    dataFScore[1][i] = r.getFscore();
    dataPrecision[0][i] = r.getIterationNumber();
    dataPrecision[1][i] = r.getPrecision();
    dataRecall[0][i] = r.getIterationNumber();
    dataRecall[1][i] = r.getRecall();
  }
  DefaultXYDataset dataset = new DefaultXYDataset();
  dataset.addSeries("F-Score", dataFScore);
  dataset.addSeries("Precision", dataPrecision);
  dataset.addSeries("Recall", dataRecall);
  JFreeChart chart = ChartFactory.createXYLineChart(null, "Increment #", "Value", dataset,
      PlotOrientation.VERTICAL, true, false, false);
  chart.getXYPlot().setRenderer(new XYSplineRenderer());
  chart.getXYPlot().getRangeAxis().setRange(0, 1.0);
  NumberAxis xAxis = new NumberAxis();
  xAxis.setTickUnit(new NumberTickUnit(1));
  xAxis.setAutoRange(true);
  xAxis.setAutoRangeIncludesZero(false);
  xAxis.setTickUnit(new NumberTickUnit(1));
  chart.getXYPlot().setDomainAxis(xAxis);
  return chart;
}

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

/**
 * Set the resolution of splines and sends a {@link RendererChangeEvent}
 * to all registered listeners.
 *
 * @param p  number of line segments between points (must be &gt; 0).
 *
 * @see #getPrecision()
 */
public void setPrecision(int p) {
  if (p <= 0) {
    throw new IllegalArgumentException("Requires p > 0.");
  }
  this.precision = p;
  fireChangeEvent();
}

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

/**
 * Set the resolution of splines and sends a {@link RendererChangeEvent}
 * to all registered listeners.
 *
 * @param p  number of line segments between points (must be > 0).
 *
 * @see #getPrecision()
 */
public void setPrecision(int p) {
  if (p <= 0) {
    throw new IllegalArgumentException("Requires p > 0.");
  }
  this.precision = p;
  fireChangeEvent();
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com