本文整理了Java中org.jfree.chart.JFreeChart.<init>()
方法的一些代码示例,展示了JFreeChart.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFreeChart.<init>()
方法的具体详情如下:
包路径:org.jfree.chart.JFreeChart
类名称:JFreeChart
方法名:<init>
[英]Creates a new chart with the given title and plot. The createLegend argument specifies whether or not a legend should be added to the chart.
Note that the ChartFactory class contains a range of static methods that will return ready-made charts, and often this is a more convenient way to create charts than using this constructor.
[中]创建具有给定标题和绘图的新图表。createLegend参数指定是否应将图例添加到图表中。
请注意,ChartFactory类包含一系列静态方法,这些方法将返回现成的图表,通常这是一种比使用此构造函数更方便的图表创建方法。
代码示例来源:origin: kiegroup/optaplanner
CategoryPlot plot = createBoxAndWhiskerChartPlot(dataset,
"Best " + scoreLevelLabel, NumberFormat.getInstance(locale));
JFreeChart chart = new JFreeChart("Best " + scoreLevelLabel + " distribution summary (higher is better)",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
bestScoreDistributionSummaryChartFileList.add(writeChartToImageFile(chart, "bestScoreDistributionSummaryLevel" + scoreLevelIndex));
代码示例来源:origin: kiegroup/optaplanner
"Problem scale", NumberFormat.getInstance(locale),
"Best " + scoreLevelLabel, NumberFormat.getInstance(locale));
JFreeChart chart = new JFreeChart(
"Best " + scoreLevelLabel + " scalability summary (higher is better)",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
代码示例来源:origin: kiegroup/optaplanner
"Time spent", new MillisecondsSpentNumberFormat(locale),
"Best " + scoreLevelLabel, NumberFormat.getInstance(locale));
JFreeChart chart = new JFreeChart(
"Best " + scoreLevelLabel + " per time spent summary (higher left is better)",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
代码示例来源:origin: kiegroup/optaplanner
private void writeBestScoreSummaryChart() {
// Each scoreLevel has its own dataset and chartFile
List<DefaultCategoryDataset> datasetList = new ArrayList<>(CHARTED_SCORE_LEVEL_SIZE);
for (SolverBenchmarkResult solverBenchmarkResult : plannerBenchmarkResult.getSolverBenchmarkResultList()) {
String solverLabel = solverBenchmarkResult.getNameWithFavoriteSuffix();
for (SingleBenchmarkResult singleBenchmarkResult : solverBenchmarkResult.getSingleBenchmarkResultList()) {
String problemLabel = singleBenchmarkResult.getProblemBenchmarkResult().getName();
if (singleBenchmarkResult.hasAllSuccess()) {
double[] levelValues = ScoreUtils.extractLevelDoubles(singleBenchmarkResult.getAverageScore());
for (int i = 0; i < levelValues.length && i < CHARTED_SCORE_LEVEL_SIZE; i++) {
if (i >= datasetList.size()) {
datasetList.add(new DefaultCategoryDataset());
}
datasetList.get(i).addValue(levelValues[i], solverLabel, problemLabel);
}
}
}
}
bestScoreSummaryChartFileList = new ArrayList<>(datasetList.size());
int scoreLevelIndex = 0;
for (DefaultCategoryDataset dataset : datasetList) {
String scoreLevelLabel = plannerBenchmarkResult.findScoreLevelLabel(scoreLevelIndex);
CategoryPlot plot = createBarChartPlot(dataset,
"Best " + scoreLevelLabel, NumberFormat.getInstance(locale));
JFreeChart chart = new JFreeChart("Best " + scoreLevelLabel + " summary (higher is better)",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
bestScoreSummaryChartFileList.add(writeChartToImageFile(chart, "bestScoreSummaryLevel" + scoreLevelIndex));
scoreLevelIndex++;
}
}
代码示例来源:origin: kiegroup/optaplanner
CategoryPlot plot = createBarChartPlot(dataset,
"Winning " + scoreLevelLabel + " difference", NumberFormat.getInstance(locale));
JFreeChart chart = new JFreeChart("Winning " + scoreLevelLabel + " difference summary (higher is better)",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
winningScoreDifferenceSummaryChartFileList.add(
代码示例来源:origin: kiegroup/optaplanner
private void writeScoreCalculationSpeedSummaryChart() {
List<XYSeries> seriesList = new ArrayList<>(plannerBenchmarkResult.getSolverBenchmarkResultList().size());
for (SolverBenchmarkResult solverBenchmarkResult : plannerBenchmarkResult.getSolverBenchmarkResultList()) {
String solverLabel = solverBenchmarkResult.getNameWithFavoriteSuffix();
XYSeries series = new XYSeries(solverLabel);
for (SingleBenchmarkResult singleBenchmarkResult : solverBenchmarkResult.getSingleBenchmarkResultList()) {
if (singleBenchmarkResult.hasAllSuccess()) {
long problemScale = singleBenchmarkResult.getProblemBenchmarkResult().getProblemScale();
long scoreCalculationSpeed = singleBenchmarkResult.getScoreCalculationSpeed();
series.add((Long) problemScale, (Long) scoreCalculationSpeed);
}
}
seriesList.add(series);
}
XYPlot plot = createScalabilityPlot(seriesList,
"Problem scale", NumberFormat.getInstance(locale),
"Score calculation speed per second", NumberFormat.getInstance(locale));
JFreeChart chart = new JFreeChart("Score calculation speed summary (higher is better)",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
scoreCalculationSpeedSummaryChartFile = writeChartToImageFile(chart, "scoreCalculationSpeedSummary");
}
代码示例来源:origin: kiegroup/optaplanner
"Worst " + scoreLevelLabel + " difference percentage",
NumberFormat.getPercentInstance(locale));
JFreeChart chart = new JFreeChart("Worst " + scoreLevelLabel + " difference percentage"
+ " summary (higher is better)",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
代码示例来源:origin: kiegroup/optaplanner
String scoreLevelLabel = subSingleBenchmarkResult.getSingleBenchmarkResult().getProblemBenchmarkResult()
.findScoreLevelLabel(scoreLevelIndex);
JFreeChart chart = new JFreeChart(subSingleBenchmarkResult.getName()
+ " picked move type best " + scoreLevelLabel + " diff statistic",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
代码示例来源:origin: kiegroup/optaplanner
String scoreLevelLabel = subSingleBenchmarkResult.getSingleBenchmarkResult().getProblemBenchmarkResult()
.findScoreLevelLabel(scoreLevelIndex);
JFreeChart chart = new JFreeChart(subSingleBenchmarkResult.getName()
+ " picked move type step " + scoreLevelLabel + " diff statistic",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
代码示例来源:origin: kiegroup/optaplanner
String scoreLevelLabel = subSingleBenchmarkResult.getSingleBenchmarkResult().getProblemBenchmarkResult()
.findScoreLevelLabel(scoreLevelIndex);
JFreeChart chart = new JFreeChart(subSingleBenchmarkResult.getName()
+ " constraint match total best " + scoreLevelLabel + " diff statistic",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
代码示例来源:origin: kiegroup/optaplanner
private void writeTimeSpentScalabilitySummaryChart() {
List<XYSeries> seriesList = new ArrayList<>(plannerBenchmarkResult.getSolverBenchmarkResultList().size());
for (SolverBenchmarkResult solverBenchmarkResult : plannerBenchmarkResult.getSolverBenchmarkResultList()) {
String solverLabel = solverBenchmarkResult.getNameWithFavoriteSuffix();
XYSeries series = new XYSeries(solverLabel);
for (SingleBenchmarkResult singleBenchmarkResult : solverBenchmarkResult.getSingleBenchmarkResultList()) {
if (singleBenchmarkResult.hasAllSuccess()) {
long problemScale = singleBenchmarkResult.getProblemBenchmarkResult().getProblemScale();
long timeMillisSpent = singleBenchmarkResult.getTimeMillisSpent();
series.add((Long) problemScale, (Long) timeMillisSpent);
}
}
seriesList.add(series);
}
XYPlot plot = createScalabilityPlot(seriesList,
"Problem scale", NumberFormat.getInstance(locale),
"Time spent", new MillisecondsSpentNumberFormat(locale));
JFreeChart chart = new JFreeChart("Time spent scalability summary (lower is better)",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
timeSpentScalabilitySummaryChartFile = writeChartToImageFile(chart, "timeSpentScalabilitySummary");
}
代码示例来源:origin: kiegroup/optaplanner
for (int scoreLevelIndex = 0; scoreLevelIndex < plotList.size(); scoreLevelIndex++) {
String scoreLevelLabel = problemBenchmarkResult.findScoreLevelLabel(scoreLevelIndex);
JFreeChart chart = new JFreeChart(
problemBenchmarkResult.getName() + " step " + scoreLevelLabel + " statistic",
JFreeChart.DEFAULT_TITLE_FONT, plotList.get(scoreLevelIndex), true);
代码示例来源:origin: kiegroup/optaplanner
XYPlot plot = new XYPlot(seriesCollection, domainAxis, rangeAxis, renderer);
plot.setOrientation(PlotOrientation.HORIZONTAL);
return new JFreeChart("Project Job Scheduling", JFreeChart.DEFAULT_TITLE_FONT,
plot, true);
代码示例来源:origin: kiegroup/optaplanner
private void writeWorstScoreCalculationSpeedDifferencePercentageSummaryChart() {
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
for (SolverBenchmarkResult solverBenchmarkResult : plannerBenchmarkResult.getSolverBenchmarkResultList()) {
String solverLabel = solverBenchmarkResult.getNameWithFavoriteSuffix();
for (SingleBenchmarkResult singleBenchmarkResult : solverBenchmarkResult.getSingleBenchmarkResultList()) {
String problemLabel = singleBenchmarkResult.getProblemBenchmarkResult().getName();
if (singleBenchmarkResult.hasAllSuccess()) {
double worstScoreCalculationSpeedDifferencePercentage
= singleBenchmarkResult.getWorstScoreCalculationSpeedDifferencePercentage();
dataset.addValue(worstScoreCalculationSpeedDifferencePercentage, solverLabel, problemLabel);
}
}
}
CategoryPlot plot = createBarChartPlot(dataset,
"Worst score calculation speed difference percentage",
NumberFormat.getPercentInstance(locale));
JFreeChart chart = new JFreeChart("Worst score calculation speed difference percentage"
+ " summary (higher is better)",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
worstScoreCalculationSpeedDifferencePercentageSummaryChartFile = writeChartToImageFile(chart, "worstScoreCalculationSpeedDifferencePercentageSummary");
}
代码示例来源:origin: kiegroup/optaplanner
private JFreeChart createChart(CheapTimeSolution solution) {
TangoColorFactory tangoColorFactory = new TangoColorFactory();
NumberAxis rangeAxis = new NumberAxis("Period");
rangeAxis.setRange(-0.5, solution.getGlobalPeriodRangeTo() + 0.5);
XYPlot taskAssignmentPlot = createTaskAssignmentPlot(tangoColorFactory, solution);
XYPlot periodCostPlot = createPeriodCostPlot(tangoColorFactory, solution);
XYPlot capacityPlot = createAvailableCapacityPlot(tangoColorFactory, solution);
CombinedRangeXYPlot combinedPlot = new CombinedRangeXYPlot(rangeAxis);
combinedPlot.add(taskAssignmentPlot, 5);
combinedPlot.add(periodCostPlot, 1);
combinedPlot.add(capacityPlot, 1);
combinedPlot.setOrientation(PlotOrientation.HORIZONTAL);
return new JFreeChart("Cheap Power Time Scheduling", JFreeChart.DEFAULT_TITLE_FONT,
combinedPlot, true);
}
代码示例来源:origin: kiegroup/optaplanner
private void writeTimeSpentSummaryChart() {
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
for (SolverBenchmarkResult solverBenchmarkResult : plannerBenchmarkResult.getSolverBenchmarkResultList()) {
String solverLabel = solverBenchmarkResult.getNameWithFavoriteSuffix();
for (SingleBenchmarkResult singleBenchmarkResult : solverBenchmarkResult.getSingleBenchmarkResultList()) {
String problemLabel = singleBenchmarkResult.getProblemBenchmarkResult().getName();
if (singleBenchmarkResult.hasAllSuccess()) {
long timeMillisSpent = singleBenchmarkResult.getTimeMillisSpent();
dataset.addValue(timeMillisSpent, solverLabel, problemLabel);
}
}
}
CategoryPlot plot = createBarChartPlot(dataset, "Time spent", new MillisecondsSpentNumberFormat(locale));
JFreeChart chart = new JFreeChart("Time spent summary (lower time is better)",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
timeSpentSummaryChartFile = writeChartToImageFile(chart, "timeSpentSummary");
}
代码示例来源:origin: kiegroup/optaplanner
seriesIndex++;
JFreeChart chart = new JFreeChart(problemBenchmarkResult.getName() + " best solution mutation statistic",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
graphFile = writeChartToImageFile(chart, problemBenchmarkResult.getName() + "BestSolutionMutationStatistic");
代码示例来源:origin: kiegroup/optaplanner
seriesIndex++;
JFreeChart chart = new JFreeChart(problemBenchmarkResult.getName() + " score calculation speed statistic",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
graphFile = writeChartToImageFile(chart, problemBenchmarkResult.getName() + "ScoreCalculationSpeedStatistic");
代码示例来源:origin: kiegroup/optaplanner
seriesIndex++;
JFreeChart chart = new JFreeChart(problemBenchmarkResult.getName() + " memory use statistic",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
graphFile = writeChartToImageFile(chart, problemBenchmarkResult.getName() + "MemoryUseStatistic");
代码示例来源:origin: kiegroup/optaplanner
JFreeChart chart = new JFreeChart(problemBenchmarkResult.getName() + " move count per step statistic",
JFreeChart.DEFAULT_TITLE_FONT, plot, true);
graphFile = writeChartToImageFile(chart, problemBenchmarkResult.getName() + "MoveCountPerStepStatistic");
内容来源于网络,如有侵权,请联系作者删除!