variables = variables.replaceAll("\\?", "");
width = Integer.parseInt(matcher.group(3));
height = Integer.parseInt(matcher.group(4));
line = matcher.group(5);
dm = ChartFactory.getModel(chartTyp, variables.split(","), queryResult);
output = dm.asImage(width, height);
result.append(Base64.encodeBase64String(output.toByteArray()));
line = replaceImage(result.toString(), line);
line = replaceLegend(dm.getLegend(), line);
}