So my issue is trying to use Google Charts offline because my client needs
to have it entirely offline for purposes of security and possible
exploitation and injection purposes using code that is embedded into their
security they already built okay. So here is my issue though. I can't get
my PHP file to select what data rows I want it to read. Now mind you I'm
just trying to get the PHP Query to read the JSON file. And to be honest
this is my first project ever using PHP and JSON. Any help would be
appreciated.
<html>
<head>
<script type="text/javascript" src="loader.js"></script>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
google.charts.load('current', {
packages:['controls', 'corechart', 'table']
}).then(function () {
var wrapper = new google.visualization.ChartWrapper( {
chartType: 'PieChart',
//query: 'SELECT A,COUNT(A) WHERE B > 100 GROUP BY A',
options: {title: 'Test', legend: 'none'},
containerId: 'vis_div'
});
wrapper.draw()
});
var jsonData = $.ajax({
url: "getData.php",
dataType: "json",
async: false
}).responseText;
</script>
</head>
<body style="font-family: Arial;border: 0 none;">
<div id="vis_div" style="width: 600px; height: 600px;"></div>
</body>
</html>
<?php
// This is just an example of reading server side data and sending it to
the client.
// It reads a json formatted text file and outputs it.
$string = file_get_contents("json.JSON");
echo $string;
$need = array(
'Status Codes',
'Purchase Order',
);
// Instead you can query your database and parse into JSON etc etc
?>
/*O_o*/
google.visualization.Query.setResponse({"version":"0.6","reqId":"0","status"
:"ok","sig":"308659504","table":{"cols":[{"id":"A","label":"Status Code",
"type":"string"},{"id":"B","label":"Purchase Order","type":"number",
"pattern":"General"}],"rows":[{"c":[{"v":"OPEN/NO RECEIPTS"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"PARTIAL RECEIPTS"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"PARTIAL RECEIPTS"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/MATL RCPT"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/MATL RCPT"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/MATL RCPT"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/MATL RCPT"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/MATL RCPT"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/MATL RCPT"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/RELEASED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/RELEASED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/RELEASED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/RELEASED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/RELEASED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/RELEASED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/RELEASED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/RELEASED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/RELEASED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/RELEASED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/PACKED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]},{"c":[{"v":"COMPLETE/DELIVERED"},{"v":
1.11899737E8,"f":"111899737"}]}]}});
--
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 https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/39154ff0-6061-43cc-8325-9b1d962507fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.