Ok, I get what you want to do now. I don't think the query language can help you there, as the column labels are never returned as data points in a column when pivoting. Query to get the sum of all columns, and pivot manually after you get your data back:
// assume data1 is a dataTable object with the data returned from your query, data2 is a dataTable set up however you like, and cols is the number of columns in data1:
for (i = 0; i < cols; i++) {
data2.addRow([data1.getColumnLabel(i), data1.getValue(0, i)]);
}
then draw your chart with data2.