From 86ce77a7c93fa80a80501e6980d607819db48085 Mon Sep 17 00:00:00 2001 From: Keith Wall Date: Thu, 5 Jul 2012 15:28:54 +0000 Subject: QPID-3977: tidy up chart generation. Specifically: - chart-summary.html now shows charts in deterministic order (dictated by the chart file names) - We now only have one set of test definitions rather than maintaining both short and standard sets of files. We will use QPID-4103 to adjust the durations across the board. - Charts have been given subtitles, and sloping CategoryLabelPositions to Plots that aren't CategoryPlots. Also added test for statistical bar charts to ChartProductionTest. Applied patch from Philip Harvey git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1357682 13f79535-47bb-0310-9956-ffa450edef68 --- .../charting/chartbuilder/CategoryDataSetBasedChartBuilder.java | 3 +++ .../disttest/charting/chartbuilder/StatisticalBarCharBuilder.java | 3 +++ .../disttest/charting/chartbuilder/XYDataSetBasedChartBuilder.java | 1 + .../java/org/apache/qpid/disttest/charting/writer/ChartWriter.java | 7 +++---- 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'qpid/java/perftests/visualisation-jfc/src/main') diff --git a/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryDataSetBasedChartBuilder.java b/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryDataSetBasedChartBuilder.java index 5617b9c330..a6c63f4560 100644 --- a/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryDataSetBasedChartBuilder.java +++ b/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/CategoryDataSetBasedChartBuilder.java @@ -25,6 +25,7 @@ import org.apache.qpid.disttest.charting.definition.SeriesDefinition; import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilderCallback; import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilder; import org.jfree.chart.JFreeChart; +import org.jfree.chart.axis.CategoryLabelPositions; import org.jfree.data.category.DefaultCategoryDataset; public abstract class CategoryDataSetBasedChartBuilder extends BaseChartBuilder @@ -74,6 +75,8 @@ public abstract class CategoryDataSetBasedChartBuilder extends BaseChartBuilder JFreeChart chart = createChartImpl(title, xAxisTitle, yAxisTitle, dataset, PLOT_ORIENTATION, SHOW_LEGEND, SHOW_TOOL_TIPS, SHOW_URLS); + chart.getCategoryPlot().getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45); + addCommonChartAttributes(chart, chartingDefinition); return chart; diff --git a/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarCharBuilder.java b/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarCharBuilder.java index 843b57939f..86c3f62e09 100644 --- a/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarCharBuilder.java +++ b/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/StatisticalBarCharBuilder.java @@ -28,6 +28,7 @@ import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilder; import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilderCallback; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.CategoryAxis; +import org.jfree.chart.axis.CategoryLabelPositions; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.axis.ValueAxis; import org.jfree.chart.plot.CategoryPlot; @@ -86,6 +87,8 @@ public class StatisticalBarCharBuilder extends BaseChartBuilder JFreeChart chart = createChartImpl(title, xAxisTitle, yAxisTitle, dataset, PLOT_ORIENTATION, SHOW_LEGEND, SHOW_TOOL_TIPS, SHOW_URLS); + chart.getCategoryPlot().getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45); + addCommonChartAttributes(chart, chartingDefinition); return chart; diff --git a/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/XYDataSetBasedChartBuilder.java b/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/XYDataSetBasedChartBuilder.java index 8d5332c126..87d61ca2ee 100644 --- a/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/XYDataSetBasedChartBuilder.java +++ b/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/chartbuilder/XYDataSetBasedChartBuilder.java @@ -28,6 +28,7 @@ import org.apache.qpid.disttest.charting.definition.SeriesDefinition; import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilderCallback; import org.apache.qpid.disttest.charting.seriesbuilder.SeriesBuilder; import org.jfree.chart.JFreeChart; +import org.jfree.chart.axis.CategoryLabelPositions; import org.jfree.data.xy.DefaultXYDataset; diff --git a/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/writer/ChartWriter.java b/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/writer/ChartWriter.java index 134933ef50..08bdf122ba 100644 --- a/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/writer/ChartWriter.java +++ b/qpid/java/perftests/visualisation-jfc/src/main/java/org/apache/qpid/disttest/charting/writer/ChartWriter.java @@ -26,8 +26,8 @@ import java.io.FileOutputStream; import java.io.FileWriter; import java.io.IOException; import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; +import java.util.SortedSet; +import java.util.TreeSet; import org.apache.qpid.disttest.charting.ChartingException; import org.jfree.chart.ChartUtilities; @@ -42,14 +42,13 @@ public class ChartWriter static final String SUMMARY_FILE_NAME = "chart-summary.html"; private File _chartDirectory = new File("."); - private List _chartFiles = new ArrayList(); + private SortedSet _chartFiles = new TreeSet(); public void writeChartToFileSystem(JFreeChart chart, String chartStemName) { OutputStream pngOutputStream = null; try { - File pngFile = new File(_chartDirectory, chartStemName + ".png"); pngOutputStream = new BufferedOutputStream(new FileOutputStream(pngFile)); ChartUtilities.writeChartAsPNG(pngOutputStream, chart, 600, 400, true, 0); -- cgit v1.2.1