}
private void produceAllCharts()
{
final ChartWriter writer = new ChartWriter();
writer.setOutputDirectory(new File(_cliOptions.get(OUTPUT_DIR_PROP)));
SeriesBuilder seriesBuilder = new JdbcSeriesBuilder(
_cliOptions.get(JDBC_DRIVER_NAME_PROP),
_cliOptions.get(JDBC_URL_PROP));
for (ChartingDefinition chartingDefinition : loadChartDefinitions())
{
try
{
ChartBuilder chartBuilder = ChartBuilderFactory.createChartBuilder(
chartingDefinition.getChartType(),
seriesBuilder);
JFreeChart chart = chartBuilder.buildChart(chartingDefinition);
writer.writeChartToFileSystem(chart, chartingDefinition);
}
catch (Exception e)
{
LOGGER.error("Couldn't produce chart " + chartingDefinition, e);
}
}
final String summaryChartTitle = _cliOptions.get(SUMMARY_TITLE_PROP);
writer.writeHtmlSummaryToFileSystem(summaryChartTitle);
}