class HealthTrendChart implements TrendChart {

    @Override
    public LinesChartModel create(final Iterable<? extends BuildResult<AnalysisBuildResult>> results,
            final ChartModelConfiguration configuration) {
        HealthSeriesBuilder builder = new HealthSeriesBuilder(healthDescriptor);
        LinesDataSet dataSet = builder.createDataSet(configuration, results);

        LinesChartModel model = new LinesChartModel();
        model.setDomainAxisLabels(dataSet.getDomainAxisLabels());

        if (healthDescriptor.isEnabled()) {
            LineSeries healthy = createSeries(Messages.Healthy_Name(), Palette.GREEN);
            healthy.addAll(dataSet.getSeries(HealthSeriesBuilder.HEALTHY));
            LineSeries intermediate = createSeries(Messages.Satisfactory_Name(), Palette.YELLOW);
            intermediate.addAll(dataSet.getSeries(HealthSeriesBuilder.BETWEEN));
            LineSeries unhealthy = createSeries(Messages.Unhealthy_Name(), Palette.RED);
            unhealthy.addAll(dataSet.getSeries(HealthSeriesBuilder.UNHEALTHY));
            model.addSeries(healthy, intermediate, unhealthy);
        }
        else {
            LineSeries total = new LineSeries(Messages.Total_Name(), Palette.YELLOW.getNormal(),
                    StackedMode.SEPARATE_LINES, FilledMode.LINES);
            total.addAll(dataSet.getSeries(HealthSeriesBuilder.TOTAL));
            model.addSeries(total);
        }

        return model;
    }

    public  HealthTrendChart(final HealthDescriptor healthDescriptor);

}