Search in sources :

Example 1 with DefaultStatisticalCategoryDataset

use of org.jfree.data.statistics.DefaultStatisticalCategoryDataset in project qpid-broker-j by apache.

the class StatisticalBarChartBuilder method newDatasetHolder.

@Override
protected DatasetHolder newDatasetHolder() {
    return new DatasetHolder() {

        private final DefaultStatisticalCategoryDataset _dataset = new DefaultStatisticalCategoryDataset();

        @Override
        public void addDataPointToSeries(SeriesDefinition seriesDefinition, SeriesRow row) {
            String x = row.dimensionAsString(0);
            double mean = row.dimensionAsDouble(1);
            double stdDev = row.dimensionAsDouble(2);
            _dataset.add(mean, stdDev, seriesDefinition.getSeriesLegend(), x);
        }

        @Override
        public void beginSeries(SeriesDefinition seriesDefinition) {
        // unused
        }

        @Override
        public void endSeries(SeriesDefinition seriesDefinition) {
        // unused
        }

        @Override
        public int getNumberOfDimensions() {
            return 3;
        }

        @Override
        public Dataset getPopulatedDataset() {
            return _dataset;
        }
    };
}
Also used : SeriesDefinition(org.apache.qpid.disttest.charting.definition.SeriesDefinition) DatasetHolder(org.apache.qpid.disttest.charting.seriesbuilder.DatasetHolder) DefaultStatisticalCategoryDataset(org.jfree.data.statistics.DefaultStatisticalCategoryDataset) SeriesRow(org.apache.qpid.disttest.charting.seriesbuilder.SeriesRow)

Aggregations

SeriesDefinition (org.apache.qpid.disttest.charting.definition.SeriesDefinition)1 DatasetHolder (org.apache.qpid.disttest.charting.seriesbuilder.DatasetHolder)1 SeriesRow (org.apache.qpid.disttest.charting.seriesbuilder.SeriesRow)1 DefaultStatisticalCategoryDataset (org.jfree.data.statistics.DefaultStatisticalCategoryDataset)1