Hi.

You need to make sure your data format complies with the data format
expected by the chart.
Specifically, make sure that the values are of type 'number' and not
'string.

For more information about the ColumnChart visualization (in the new
corechart package), see
http://code.google.com/apis/visualization/documentation/gallery/columnchart.html

Best,
  Viz Kid

On Sat, Aug 21, 2010 at 7:36 AM, pandiya <[email protected]> wrote:

> I use,
>
>
>    google.load('visualization', '1', {'packages': ['columnchart']});
>    //google.setOnLoadCallback(drawChart);
>    function drawChart(response) {
>        alert(response.customerlist);
>        var data = new google.visualization.DataTable();
>        data.addColumn('string', 'dbZipcode');
>        data.addColumn('string', 'countusers');
>        data.addRows(response.customerlist.length);
>        for (var i = 0; i < response.customerlist.length; i++) {
>            data.setValue(i, 0, response.customerlist[i].dbZipcode);
>            data.setValue(i, 1, response.customerlist[i].countusers);
>        }
>        var container = document.getElementById('spnChart');
>        container.innerHTML = "";
>        var chart = new google.visualization.ColumnChart(container);
>        chart.draw(data, {width: 800, height: 300, is3D: true, title:
> 'Page Views',
>                          legend:'none', titleX:'ZipCode',
> titleY:'Total Users'});
>    }
>
> But my chart doesn't contain the drawn graph. Any suggestion.
> ![alt text][1]
>
>
> and my json data,
>
>    {
>        "customerlist": [
>            { "dbZipcode": "21313213",     "countusers": "1" },
>            { "dbZipcode": "2313213",      "countusers": "1" },
>            { "dbZipcode": "23324324",     "countusers": "1" },
>            { "dbZipcode": "2342432",      "countusers": "1" },
>            { "dbZipcode": "32424422343",  "countusers": "1" },
>            { "dbZipcode": "324324324",    "countusers": "1" },
>            { "dbZipcode": "324324324324", "countusers": "1" },
>            { "dbZipcode": "3244324",      "countusers": "1" },
>            { "dbZipcode": "3422344",      "countusers": "1" },
>            { "dbZipcode": "342424324",    "countusers": "1" },
>            { "dbZipcode": "3424324",      "countusers": "1" },
>            { "dbZipcode": "435345",       "countusers": "1" },
>            { "dbZipcode": "627028",       "countusers": "1" },
>            { "dbZipcode": "641030",       "countusers": "2" },
>            { "dbZipcode": "642582",       "countusers": "1" }
>        ]
>    }
>
>  [1]: http://i.imgur.com/TeCFM.jpg
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-visualization-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-visualization-api?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
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