Do you plan to have controls that work on the PieChart?  If you do, then 
you need to add a control and bind the control to the PieChart in the 
Dashboard.  If not, then you want to get rid of the lines for the dashboard 
at the bottom of the chart, add a "dataTable" parameter to the 
ChartWrapper, with "data" (no quotes) as the value, and call chart.draw():

var chart = new google.visualization.ChartWrapper({
    chartType: 'PieChart',
    containerId: 'chart_div',
    dataTable: data,
    options: {
        title: 'Percentage',
        width: 600,
        height: 400
    },
    view: {
        columns: [1,2]
    }
});
chart.draw();

On Friday, April 12, 2013 2:00:57 AM UTC-4, kolo ken wrote:
>
> Thanks again.. now i would like to create a piechart, from my database, 
> e,g Column: insert into(Item,Type,Value)
> what is my problem in my html coding???, chart no display
>
> *goo3.html*
> google.load('visualization', '1', {packages: ['corechart']});
> google.setOnLoadCallback(drawChart);
>  
>       function drawChart() {
>    var jsonData =$.ajax({
>           url: "goo.php",
>           dataType:"json",
>           async: false
>           }).responseText;
>              
>     var data = new google.visualization.DataTable(jsonData);
>   
>     var columnsTable = new google.visualization.DataTable();
>     columnsTable.addColumn('number', 'colIndex');
>     columnsTable.addColumn('string', 'colLabel');
>     var initState= {selectedValues: []};
>     for (var i = 1; i < data.getNumberOfColumns(); i++) {
>         columnsTable.addRow([i, data.getColumnLabel(i)]);
>         initState.selectedValues.push(data.getColumnLabel(i));
>     }
>     var chart = new google.visualization.ChartWrapper({
>         chartType: 'PieChart',
>         containerId: 'chart_div',
>         options: {
>             title: 'Percentage',
>             width: 600,
>             height: 400
>         },
>         view: {
>         columns: [1,2]
>     }
>     });
>     var dashboard = new 
> google.visualization.PieChart(document.getElementById('dash_div'));
>     dashboard.draw(data);
> }
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to