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; }
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; }
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; }
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; }
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; }
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; }
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; }
return new XYPlot(seriesCollection, domainAxis, null, renderer);
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,
domainAxis.setRange(-0.5, taskAssignmentList.size() - 0.5); domainAxis.setInverted(true); return new XYPlot(seriesCollection, domainAxis, null, renderer);
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); }
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; }
yAxis.setNumberFormatOverride(NumberFormat.getInstance(locale)); yAxis.setAutoRangeIncludesZero(false); XYPlot plot = new XYPlot(null, xAxis, yAxis, null); plot.setOrientation(PlotOrientation.VERTICAL); int seriesIndex = 0;
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;
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);
XYItemRenderer renderer1 = new StandardXYItemRenderer(); NumberAxis rangeAxis1 = new NumberAxis(aes.getIndexToError().get(i)); XYPlot subplot1 = new XYPlot(data1, null, rangeAxis1, renderer1);
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);
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; }
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); } }
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); } }