int comma = query.indexOf(",");
int closeParen = query.indexOf(")", comma);
int colon = query.indexOf(":", closeParen);
if(comma == -1 || closeParen == -1 || colon != closeParen+1)
throw new WikiQueryException(WikiQueryException.UnknownQueryFormat, _queryString);
xSize = query.substring(1, comma);
ySize = query.substring(comma+1, closeParen);
query = query.substring(colon+1);
} else {
query = query.substring(1);
}
QueryResultSet rs = database.query(query);
body.openPARAGRAPH(CSS.CSSPageText);
drawChart(ChartType.Column, xSize, ySize, rs, body);
} else if(query.toLowerCase().startsWith("pie:") || query.toLowerCase().startsWith("pie(")) {
// FIXME: should parse the arguments to charts in a more
// sensible scalable way.
query = query.substring("pie".length());
String xSize = "800";
String ySize = "600";
if(query.startsWith("(")) {
int comma = query.indexOf(",");
int closeParen = query.indexOf(")", comma);
int colon = query.indexOf(":", closeParen);
if(comma == -1 || closeParen == -1 || colon != closeParen+1)
throw new WikiQueryException(WikiQueryException.UnknownQueryFormat, _queryString);
xSize = query.substring(1, comma);
ySize = query.substring(comma+1, closeParen);
query = query.substring(colon+1);
} else {