thanks for reply asgallant, I built everything by reading all your previous
comments history, I was testing everything locally on my laptop using
xampp got the 405 error, moved everything to my school provided space on
.edu, same error.
all your previous comments on other threads are really helpful.
my .php file output sample, it's really big file, just showed a few lines,
from echo json_encode($output);
[["Date(2012,04,12,12,50,02)","15662","5589","7999","2074","1488","425"],["Date(2012,04,12,1,00,03)","15662","5589","7999","2074","1488","425"],["Date(2012,04,12,1,10,02)","15242","5555","7603","2084","1430","413"]]
.html file :
<html>
<head>
<script type='text/javascript' src='http://www.google.com/jsapi
'></script>
<script type="text/javascript" src="jquery.min.js"></script>
<script type='text/javascript'>
google.load('visualization', '1', {'packages':['annotatedtimeline']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('datetime', 'Date');
data.addColumn('number', 'n1');
data.addColumn('number', 'n2');
data.addColumn('number', 'n3');
data.addColumn('number', 'n4');
data.addColumn('number', 'n5');
data.addColumn('number', 'n6');
var now = new Date();
var chart = new
google.visualization.AnnotatedTimeLine(document.getElementById('chart_div'));
function updateData () {
$.ajax({
url: 'http://localhost/db_chartjson.php',
dataType: 'json',
type: 'POST',
crossDomain: true,
success: function (json) {
data.removeRows(0, data.getNumberOfRows());
data.addRows(json);
chart.draw(data,{width: 400, height: 240});
// refresh data in 1 minute
setTimeout(function () {
updateData();
}, 60000);
}
});
}
}
</script>
</head>
<body>
<div id='chart_div' ></div>
</body>
</html>
On Monday, November 12, 2012 5:50:49 PM UTC-5, asgallant wrote:
>
> Can you post your source code?
>
> Since you're using xampp, I assume you're accessing the HTML file through
> the webserver rather than locally, but if you're not, then this could be a
> Flash security issue (see the
> Notes<https://developers.google.com/chart/interactive/docs/gallery/annotatedtimeline#notes>section
> in the ATL documentation for details).
>
> On Monday, November 12, 2012 5:22:37 PM UTC-5, sam wrote:
>>
>> Hi,
>> I am using mysql/php to create json data, in addition have test.html
>> that read json and draws annotated timeline,
>>
>> keep getting "OPTIONS http://www.google.com/jsapi 405 (Method Not
>> Allowed)" error
>>
>> "XMLHttpRequest cannot load http://www.google.com/jsapi. Origin
>> http://nova.it.rit.edu is not allowed by Access-Control-Allow-Origin."
>>
>> need urgent help, I am using xampp
>>
>> thanks
>>
>
--
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/-/yokdLG9VC8AJ.
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.