if (isDeprecatedChart(request)) {
deprecatedDoGet(request, response);
} else {
ChartFactory chartFactory = Platform.getInstance().getContainer().getComponentByType(ChartFactory.class);
Chart chart = chartFactory.getChart(request.getParameter("ck"));
if (chart != null) {
BufferedImage image = chart.generateImage(getParams(request));
OutputStream out = response.getOutputStream();
try {
response.setContentType("image/png");
exportAsPNG(image, out);
} catch (Exception e) {
LOG.error("Generating chart " + chart.getClass().getName(), e);
} finally {
out.close();
}
}