def dict_to_json(xcol, ycols, labels, value_columns):
json_data = dict()<EOL>json_data['<STR_LIT>'] = [{'<STR_LIT:id>': xcol,<EOL>'<STR_LIT:label>': as_unicode(labels[xcol]),<EOL>'<STR_LIT:type>': '<STR_LIT:string>'}]<EOL>for ycol in ycols:<EOL><INDENT>json_data['<STR_LIT>'].append({'<STR_LIT:id>': ycol,<EOL>'<STR_LIT:label>': as_unicode(labels[ycol]),<EOL>'<STR_LIT:type>': '<STR_LIT>'})<EOL><DEDENT>json_data['<STR_LIT>'] = []<EOL>for value in value_columns:<EOL><INDENT>row = {'<STR_LIT:c>': []}<EOL>if isinstance(value[xcol], datetime.date):<EOL><INDENT>row['<STR_LIT:c>'].append({'<STR_LIT:v>': (str(value[xcol]))})<EOL><DEDENT>else:<EOL><INDENT>row['<STR_LIT:c>'].append({'<STR_LIT:v>': (value[xcol])})<EOL><DEDENT>for ycol in ycols:<EOL><INDENT>if value[ycol]:<EOL><INDENT>row['<STR_LIT:c>'].append({'<STR_LIT:v>': (value[ycol])})<EOL><DEDENT>else:<EOL><INDENT>row['<STR_LIT:c>'].append({'<STR_LIT:v>': <NUM_LIT:0>})<EOL><DEDENT><DEDENT>json_data['<STR_LIT>'].append(row)<EOL><DEDENT>return json_data<EOL>
Converts a list of dicts from datamodel query results
to google chart json data.

:param xcol:
    The name of a string column to be used has X axis on chart
:param ycols:
    A list with the names of series cols, that can be used as numeric
:param labels:
    A dict with the columns labels.
:param value_columns:
    A list of dicts with the values to convert