org.jfree.chart.plot.XYPlot.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(11.1k)|赞(0)|评价(0)|浏览(121)

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

XYPlot.<init>介绍

[英]Creates a new XYPlot instance with no dataset, no axes and no renderer. You should specify these items before using the plot.
[中]创建没有数据集、轴和渲染器的新XYPlot实例。在使用绘图之前,应指定这些项目。

代码示例

代码示例来源:origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  NumberAxis yAxis = new NumberAxis("Best solution mutation count");
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(true);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}

代码示例来源:origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = problemBenchmarkResult.findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Step " + scoreLevelLabel);
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(false);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}

代码示例来源:origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = problemBenchmarkResult.findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Best " + scoreLevelLabel);
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(false);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}

代码示例来源:origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = subSingleBenchmarkResult.getSingleBenchmarkResult().getProblemBenchmarkResult()
      .findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Constraint match total " + scoreLevelLabel);
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(false);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}

代码示例来源:origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = subSingleBenchmarkResult.getSingleBenchmarkResult().getProblemBenchmarkResult()
      .findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Constraint match total " + scoreLevelLabel);
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(false);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}

代码示例来源:origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = subSingleBenchmarkResult.getSingleBenchmarkResult().getProblemBenchmarkResult()
      .findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Step " + scoreLevelLabel + " diff");
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(true);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}

代码示例来源:origin: kiegroup/optaplanner

private XYPlot createPlot(BenchmarkReport benchmarkReport, int scoreLevelIndex) {
  Locale locale = benchmarkReport.getLocale();
  NumberAxis xAxis = new NumberAxis("Time spent");
  xAxis.setNumberFormatOverride(new MillisecondsSpentNumberFormat(locale));
  String scoreLevelLabel = subSingleBenchmarkResult.getSingleBenchmarkResult().getProblemBenchmarkResult()
      .findScoreLevelLabel(scoreLevelIndex);
  NumberAxis yAxis = new NumberAxis("Best " + scoreLevelLabel + "  diff");
  yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
  yAxis.setAutoRangeIncludesZero(true);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}

代码示例来源:origin: kiegroup/optaplanner

return new XYPlot(seriesCollection, domainAxis, null, renderer);

代码示例来源:origin: kiegroup/optaplanner

NumberAxis rangeAxis = new NumberAxis("Day (start to end date)");
rangeAxis.setRange(-0.5, maximumEndDate + 0.5);
XYPlot plot = new XYPlot(seriesCollection, domainAxis, rangeAxis, renderer);
plot.setOrientation(PlotOrientation.HORIZONTAL);
return new JFreeChart("Project Job Scheduling", JFreeChart.DEFAULT_TITLE_FONT,

代码示例来源:origin: kiegroup/optaplanner

domainAxis.setRange(-0.5, taskAssignmentList.size() - 0.5);
domainAxis.setInverted(true);
return new XYPlot(seriesCollection, domainAxis, null, renderer);

代码示例来源:origin: kiegroup/optaplanner

private XYPlot createPeriodCostPlot(TangoColorFactory tangoColorFactory, CheapTimeSolution solution) {
  XYSeries series = new XYSeries("Power price");
  for (PeriodPowerPrice periodPowerPrice : solution.getPeriodPowerPriceList()) {
    series.add((double) periodPowerPrice.getPowerPriceMicros() / 1000000.0, periodPowerPrice.getPeriod());
  }
  XYSeriesCollection seriesCollection = new XYSeriesCollection();
  seriesCollection.addSeries(series);
  XYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.SHAPES);
  renderer.setSeriesPaint(0, TangoColorFactory.ORANGE_1);
  renderer.setSeriesShape(0, ShapeUtilities.createDiamond(2.0F));
  NumberAxis domainAxis = new NumberAxis("Power price");
  return new XYPlot(seriesCollection, domainAxis, null, renderer);
}

代码示例来源:origin: kiegroup/optaplanner

private XYPlot createScalabilityPlot(List<XYSeries> seriesList,
    String xAxisLabel, NumberFormat xAxisNumberFormat,
    String yAxisLabel, NumberFormat yAxisNumberFormat) {
  NumberAxis xAxis;
  if (useLogarithmicProblemScale(seriesList)) {
    LogarithmicAxis logarithmicAxis = new LogarithmicAxis(xAxisLabel + " (logarithmic)");
    logarithmicAxis.setAllowNegativesFlag(true);
    xAxis = logarithmicAxis;
  } else {
    xAxis = new NumberAxis(xAxisLabel);
  }
  xAxis.setNumberFormatOverride(xAxisNumberFormat);
  NumberAxis yAxis = new NumberAxis(yAxisLabel);
  yAxis.setNumberFormatOverride(yAxisNumberFormat);
  XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
  int seriesIndex = 0;
  for (XYSeries series : seriesList) {
    XYSeriesCollection seriesCollection = new XYSeriesCollection();
    seriesCollection.addSeries(series);
    plot.setDataset(seriesIndex, seriesCollection);
    XYItemRenderer renderer = createScalabilityPlotRenderer(yAxisNumberFormat);
    plot.setRenderer(seriesIndex, renderer);
    seriesIndex++;
  }
  plot.setOrientation(PlotOrientation.VERTICAL);
  return plot;
}

代码示例来源:origin: kiegroup/optaplanner

yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
yAxis.setAutoRangeIncludesZero(false);
XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
plot.setOrientation(PlotOrientation.VERTICAL);
int seriesIndex = 0;

代码示例来源:origin: kiegroup/optaplanner

NumberAxis yAxis = new NumberAxis("Memory (bytes)");
yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
plot.setOrientation(PlotOrientation.VERTICAL);
int seriesIndex = 0;

代码示例来源:origin: kiegroup/optaplanner

NumberAxis yAxis = new NumberAxis("Accepted/selected moves per step");
yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale));
XYPlot plot = new XYPlot(null, xAxis, yAxis, null);
DrawingSupplier drawingSupplier = new DefaultDrawingSupplier();
plot.setOrientation(PlotOrientation.VERTICAL);

代码示例来源:origin: yahoo/egads

XYItemRenderer renderer1 = new StandardXYItemRenderer();
NumberAxis rangeAxis1 = new NumberAxis(aes.getIndexToError().get(i));
XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);

代码示例来源:origin: yahoo/egads

final XYItemRenderer renderer1 = new StandardXYItemRenderer();
final NumberAxis rangeAxis1 = new NumberAxis("Original Value");
XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);
subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
final NumberAxis rangeAxis2 = new NumberAxis("Forecast Value");
rangeAxis2.setAutoRangeIncludesZero(false);
final XYPlot subplot2 = new XYPlot(data2, null, rangeAxis2, renderer2);
subplot2.setRangeAxisLocation(AxisLocation.TOP_OR_LEFT);

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

private XYPlot createPlot(final XYSeriesCollection problem, XYSeriesCollection shipments, XYSeriesCollection solution) {
  XYPlot plot = new XYPlot();
  plot.setBackgroundPaint(Color.LIGHT_GRAY);
  plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
  plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
  XYLineAndShapeRenderer problemRenderer = getProblemRenderer(problem);
  plot.setDataset(0, problem);
  plot.setRenderer(0, problemRenderer);
  XYItemRenderer shipmentsRenderer = getShipmentRenderer(shipments);
  plot.setDataset(1, shipments);
  plot.setRenderer(1, shipmentsRenderer);
  if (solution != null) {
    XYItemRenderer solutionRenderer = getRouteRenderer(solution);
    plot.setDataset(2, solution);
    plot.setRenderer(2, solutionRenderer);
  }
  NumberAxis xAxis = new NumberAxis();
  NumberAxis yAxis = new NumberAxis();
  if (boundingBox == null) {
    xAxis.setRangeWithMargins(getDomainRange(problem));
    yAxis.setRangeWithMargins(getRange(problem));
  } else {
    xAxis.setRangeWithMargins(new Range(boundingBox.minX, boundingBox.maxX));
    yAxis.setRangeWithMargins(new Range(boundingBox.minY, boundingBox.maxY));
  }
  plot.setDomainAxis(xAxis);
  plot.setRangeAxis(yAxis);
  return plot;
}

代码示例来源:origin: us.ihmc/ihmc-avatar-interfaces

private JFreeChart createChart(String title, XYDataset magDataset, String freqUnits, String magnitudeUnits)
  {
   XYItemRenderer renderer1 = new StandardXYItemRenderer();
   NumberAxis rangeAxis1 = new NumberAxis("Magnitude " + magnitudeUnits);
   XYPlot subplot1 = new XYPlot(magDataset, new LogarithmicAxis("Frequency " + freqUnits), rangeAxis1, renderer1);
   subplot1.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
   renderer1.setSeriesVisibleInLegend(0, false);
   return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, subplot1, true);
  }
}

代码示例来源:origin: eu.limetri.client/mapviewer-weather

private JFreeChart createBarChart(String title, String xAxisLabel,
      String yAxisLabel, XYDataset dataset, boolean legend) {

    DateAxis xAxis = new DateAxis(xAxisLabel);
    xAxis.setDateFormatOverride(AXIS_DATE_FORMAT);
    NumberAxis yAxis = new NumberAxis(yAxisLabel);

    XYBarRenderer renderer = new XYBarRenderer();
    renderer.setShadowVisible(false);
    XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
    plot.setOrientation(PlotOrientation.VERTICAL);
    return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
  }
}

相关文章

微信公众号

最新文章

更多

XYPlot类方法