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

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

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

JFreeChart.getXYPlot介绍

[英]Returns the plot cast as an XYPlot.

NOTE: if the plot is not an instance of XYPlot, then a ClassCastException is thrown.
[中]返回强制转换为XYPlot的打印。
注意:如果绘图不是XYPlot的实例,则会抛出ClassCastException。

代码示例

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

final JFreeChart result = ChartFactory.createTimeSeriesChart(
  TITLE, "hh:mm:ss", "milliVolts", dataset, true, true, false);
final XYPlot plot = result.getXYPlot();
ValueAxis domain = plot.getDomainAxis();
domain.setAutoRange(true);

代码示例来源:origin: graphhopper/jsprit

/**
 * Builds and returns JFreeChart.
 *
 * @return
 */
public JFreeChart build() {
  XYSeriesCollection collection = new XYSeriesCollection();
  for (XYSeries s : seriesMap.values()) {
    collection.addSeries(s);
  }
  JFreeChart chart = ChartFactory.createXYLineChart(chartName, xDomain, yDomain, collection, PlotOrientation.VERTICAL, true, true, false);
  XYPlot plot = chart.getXYPlot();
  plot.setBackgroundPaint(Color.WHITE);
  plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
  plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
  return chart;
}

代码示例来源:origin: psi-probe/psi-probe

showLegend, false, false);
((XYAreaRenderer) chart.getXYPlot().getRenderer()).setOutline(true);
chart.getXYPlot().setRenderer(renderer);
for (int i = 0; i < seriesMaxCount; i++) {
 if (seriesColor[i] >= 0) {
  chart.getXYPlot().getRenderer().setSeriesPaint(i, new Color(seriesColor[i]));
  chart.getXYPlot().getRenderer().setSeriesOutlinePaint(i,
    new Color(seriesOutlineColor[i]));
chart.getXYPlot().setDomainGridlinePaint(new Color(gridColor));
chart.getXYPlot().setRangeGridlinePaint(new Color(gridColor));
chart.getXYPlot().setDomainAxis(0, new DateAxis());
chart.getXYPlot().setDomainAxis(1, new DateAxis());
chart.getXYPlot().setInsets(new RectangleInsets(-15, 0, 0, 10));

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

title, "Elapsed Time (secs)", "Response Time (secs)",
  createDataset(), PlotOrientation.VERTICAL, true, true, false);
XYPlot plot = chart.getXYPlot();
MyRenderer renderer = new MyRenderer(true, true, N);
plot.setRenderer(renderer);

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

final JFreeChart chart = ChartFactory.createCandlestickChart(
     "Candlestick Demo", "Time", "Price", dataset, false);
 double lowestLow = getLowestLow(dataset);
 double highestHigh = getHighestHigh(dataset);
 chart.getXYPlot().getRangeAxis().setRange(lowestLow*0.95, highestHigh*1.05);

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

JFreeChart chart = // create your XY chart here.
XYPlot plot = chart.getXYPlot();
OHLCSeriesCollection ohlsSeriesDataset = // create you ohlc dataset here.
TimeSeriesCollection timeSeriesDataset = // create you time dataset here.
AbstractXYItemRenderer olhsSeriesRenderer = // create your ohlc renderer here.
AbstractXYItemRenderer timeSeriesRenderer = // create your time renderer here.

plot.setDataset(0, ohlsSeriesDataset);
plot.setDataset(1, timeSeriesDataset);
plot.setRenderer(0, olhsSeriesRenderer);
plot.setRenderer(1, timeSeriesRenderer);

代码示例来源:origin: org.cytoscape/network-analyzer-impl

/**
 * Updates the general properties of a chart.
 * 
 * @param aControl
 *            Chart control to be updated.
 * @param aGeneral
 *            General visual settings to be applied.
 */
public static void updateGeneral(JFreeChart aControl, GeneralVisSettings aGeneral) {
  updateGeneral(aControl.getXYPlot(), aGeneral);
}

代码示例来源:origin: org.cytoscape/network-analyzer-impl

/**
 * Updates the bar properties of a chart.
 * 
 * @param aControl
 *            Chart control to be updated.
 * @param aBars
 *            Bar visual settings to be applied.
 */
public static void updateBars(JFreeChart aControl, BarsSettings aBars) {
  updateBars(aControl.getXYPlot(), aBars);
}

代码示例来源:origin: matsim-org/matsim

public static void changeSeriesColors(JFreeChart chart, Paint... paints) {
    XYItemRenderer renderer = chart.getXYPlot().getRenderer();
    for (int i = 0; i < paints.length; i++) {
      renderer.setSeriesPaint(i, paints[i]);
    }
  }
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

private void setPlotStroke(int seriesNumber, BasicStroke stroke)
{
 XYItemRenderer renderer = graph.getXYPlot().getRenderer();
 renderer.setSeriesStroke(seriesNumber, stroke);
}

代码示例来源:origin: org.codehaus.mojo/chronos-report-maven-plugin

public static XYPlot setUpperBound( JFreeChart chart, double max )
{
  XYPlot plot = chart.getXYPlot();
  ValueAxis axis = plot.getDomainAxis();
  axis.setUpperBound( max );
  return plot;
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

private void setPlotColor(int seriesNumber, Color color)
{
 XYItemRenderer renderer = graph.getXYPlot().getRenderer();
 renderer.setSeriesPaint(seriesNumber, color);
}

代码示例来源:origin: senbox-org/snap-desktop

private void adjustPlotAxes() {
  if (!axisAdjusting) {
    axisAdjusting = true;
    try {
      xAxisRangeControl.adjustAxis(chart.getXYPlot().getDomainAxis(), 0);
      yAxisRangeControl.adjustAxis(chart.getXYPlot().getRangeAxis(), 2);
    } finally {
      axisAdjusting = false;
    }
  }
}

代码示例来源: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: com.anrisoftware.prefdialog/prefdialog-misc-swing

@OnAwt
@Override
public void setShowShapes(boolean flag) {
  boolean oldValue = this.showShapes;
  if (oldValue != flag) {
    this.showShapes = flag;
    XYPlot plot = chart.getXYPlot();
    plot.setRenderer(createLineShapeRenderer());
  }
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

public void setXAxisTickUnit(double tickUnit)
{
 // this needs to be fixed, if setUpGraph is called after this then it overwrites it.
 XYPlot xyplot = graph.getXYPlot();
 NumberAxis numberAxis = (NumberAxis) xyplot.getDomainAxis();
 numberAxis.setTickUnit(new NumberTickUnit(tickUnit));
}

代码示例来源:origin: us.ihmc/simulation-construction-set-tools

public void setYAxisRange(double start, double end)
{
 // this needs to be fixed, if setUpGraph is called after this then it overwrites it.
 XYPlot xyplot = graph.getXYPlot();
 NumberAxis numberAxis = (NumberAxis) xyplot.getRangeAxis();
 numberAxis.setRange(new Range(start, end));
}

代码示例来源:origin: org.codehaus.mojo/chronos-report-maven-plugin

public static XYPlot setupXYPlot( JFreeChart chart, DateFormat dateFormat )
{
  XYPlot plot = chart.getXYPlot();
  DateAxis axis = (DateAxis) plot.getDomainAxis();
  axis.setDateFormatOverride( dateFormat );
  NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
  rangeAxis.setStandardTickUnits( NumberAxis.createIntegerTickUnits() );
  return plot;
}

代码示例来源:origin: senbox-org/snap-desktop

private void updateRenderer(int seriesIndex, Color seriesColor, DisplayableSpectrum spectrum, JFreeChart chart) {
  final XYItemRenderer renderer = chart.getXYPlot().getRenderer();
  renderer.setSeriesPaint(seriesIndex, seriesColor);
  final Stroke lineStyle = spectrum.getLineStyle();
  renderer.setSeriesStroke(seriesIndex, lineStyle);
  Shape symbol = spectrum.getScaledShape();
  renderer.setSeriesShape(seriesIndex, symbol);
}

代码示例来源:origin: senbox-org/snap-desktop

private void handleStxChange() {
  if (model.hasStx(createHistogramConfig())) {
    refreshButton.setEnabled(false);
  }
  log10HistEnablement.apply();
  updateLogXAxisCheckBox();
  chart.getXYPlot().setDataset(dataset);
  updateXAxis();
  chart.fireChartChanged();
}

相关文章