I'm trying to use goggle chartsapi for data stored in a list in sharepoint 2013 platform. I'm not receiving any error messages but the chat section says -*" No Data". *i'm hoping this the right platform to put this question. Here is my code:
<script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1.0', {'packages':['corechart']}); $(document).ready(function() { GetMyData(); }); var dataArray=[[{label: 'Name', id: 'Name', type: 'string'},{label: 'Hours', id: 'Hours', type: 'number'}]]; function drawChart() { var data = google.visualization.arrayToDataTable(dataArray); var options = {'title':'Utization on portal projects', 'width':400, 'height':300}; var chart = new google.visualization.PieChart(document.getElementById('chart_div')); chart.draw(data, options); } function GetMyData() { var soapEnv1 = "<soapenv:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> \ <soapenv:Body> \ <GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'> \ <listName>utilization</listName> \ <ViewFields>\ <FieldRef Name='Title' />\ <FieldRef Name='portal' />\ </ViewFields>\ <query><Query> \ <Where><IsNotNull><FieldRef Name='Title' /></IsNotNull></Where>\ </Query></query>\ </GetListItems>\ </soapenv:Body>\ </soapenv:Envelope>"; $.ajax({ url: "https://training-site/_vti_bin/lists.asmx", type: "POST", dataType: "xml", data: soapEnv1, complete: processResult1, contentType: "text/xml; charset=\"utf-8\"" }); function processResult1(xData1, status1) { var extract1; var extract2; $(xData1.responseXML).find("z\\:row").each(function() { extract1 = $(this).attr("ows_Title"); extract2 = $(this).attr("ows_portal"); dataArray.push([extract1,extract2]); }); } drawChart(); } </script> <div id="chart_div"></div> -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/b1384b21-43fa-4a13-8e8e-0c9a86486a70%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
