Hi,
I'm trying to use an external file as an input to a Google Chart in
sharepoint. After some research I found a reasonably simple way to do this:
https://developers.google.com/chart/interactive/docs/php_example
The example uses an ajax call to a php file to return json file data.
I saved the php file and sampleData.json file to a location on the
sharepoint. The php file simply says:
$string =
file_get_contents("https://etc/etc.../Shared%20Documents/scripts/sampleData.json");
echo $string;
In my drawChart function I set the url parameter to the location of the php
file as below. However, the chart is not drawn. Am I doing something
obviously wrong? I think it may be the url parameter? Any ideas?
function drawChart() {
var jsonData = $.ajax({
url: "https://etc/etc//Shared%20Documents/scripts/getData.php",
dataType:"json",
async: false
}).responseText;
// Create our data table out of JSON data loaded from server.
var data = new google.visualization.DataTable(jsonData);
}
Thanks
K
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/VSwL2kqmICoJ.
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.