Hi All

I have a problem: table has no columns

Below are my codes. Please help me to find the error.

pie.jsp
----------
<%@page contentType="application/json; charset=UTF-8"%>
<%@page import="net.sf.json.JSONObject,net.sf.json.JSONArray"%>

<%    
    JSONObject obj=new JSONObject();
    obj.put("name","foo");
    obj.put("num",new Integer(100));
    obj.put("balance",new Double(1000.21));
    obj.put("is_vip",new Boolean(true));
    obj.put("nickname",null);
    out.print(obj);
    out.flush();
%>
---------------------------------------------------------
Charts.jsp
--------------

<html>
    <head>
        <title>Charts</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" 
/>
        <script type="text/javascript" src="js/jsapi.js"></script>
        <script type="text/javascript" 
src="js/jquery-1.7.1.min.js"></script>
        <script type="text/javascript">
            google.load("visualization", "1", {packages:["corechart"]});
            google.setOnLoadCallback(drawChart);
            function drawChart() {
                var jsonData = $.ajax({
                                url: "./charts/pie.jsp",
                                dataType:"json",
                                async: false,
                                options: {'title': 'Reports'}
                                }).responseText;
               var data = new google.visualization.DataTable(jsonData);
               var chart = new 
google.visualization.PieChart(document.getElementById('chart_div'));
               chart.draw(data, {width: 400, height: 240});
            }
        </script>    
    </head>
    <body>
        <h3>Charts Demo</h3>
        <div id="chart_div" style="width: 400px; height: 200px;"></div>
    </body>
</html>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart 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-chart-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to