If you use PHP, a trick I use to get around that problem is to put each 
output row into an array first (leave out the commas) then use the implode 
function to glue the array pieces together with commas.  When you are 
dealing with JSON specifically, an even better solution is to put the data 
into an associative array and output it with the json_encode() function. 
 Ex:

$output = array (
    'rows' => array (
       array (
           'c' => array (
               array ('v' => 'Mushrooms', 'f' => null),
               array ('v' => 3, 'f' => null)
           ),
           'c' => array (
               array ('v' => 'Onions', 'f' => null),
               array ('v' => 1, 'f' => null)
           ),
           'c' => array (
               array ('v' => 'Olives', 'f' => null),
               array ('v' => 1, 'f' => null)
           ),
               'c' => array (
               array ('v' => 'Zucchini', 'f' => null),
               array ('v' => 1, 'f' => null)
           ),
           'c' => array (
               array ('v' => 'Pepperoni', 'f' => null),
               array ('v' => 2, 'f' => null)
           )
       )
    )
);
echo json_encode($output);

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/Kq9n3wOIKycJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to