I am using this API and I want to pass data from another php file containing data using AJAX, Please guide me how to go about this.
<script type="text/javascript" src="
http://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', {packages: ['annotatedtimeline']});
function drawVisualization() {
var data = new google.visualization.DataTable();
data.addColumn('datetime', 'Datetime');
data.addColumn('number', 'Scans');
data.addRows([
[new Date(2008, 1 ,1), 30000, undefined, undefined, 40645, undefined, undefined],
[new Date(2008, 1 ,2), 14045, undefined, undefined, 20374, undefined, undefined],
]);
var now = new Date(); //current date
var annotatedtimeline = new google.visualization.AnnotatedTimeLine(
document.getElementById('visualization'));
annotatedtimeline.draw(data, {
//'allValuesSuffix': '%', // A suffix that is added to all values
'colors': ['#005EFF'], // The colors to be used
'allowRedraw':true,
'displayAnnotations': false,
'displayExactValues': true, // Do not truncate values (i.e. using K suffix)
'displayRangeSelector' : true, // Do not sow the range selector
'displayZoomButtons': true, // DO not display the zoom buttons
'fill': 15, // Fill the area below the lines with 20% opacity
'legendPosition': 'newRow', // Can be sameRow
//'max': 100000, // Override the automatic default
//'min': 100000, // Override the automatic default
'scaleColumns': [0, 1], // Have two scales, by the first and second lines
'scaleType': 'allfixed', // See docs...
'thickness': 1, // Make the lines thicker
'zoomStartTime': new Date(now - 12*60*60*1000), //NOTE: month 1 = Feb (javascript to blame)
'zoomEndTime': new Date(now - 4*60*60*1000) //NOTE: month 1 = Feb (javascript to blame)
});
}
google.setOnLoadCallback(drawVisualization);
</script>
<div id="visualization" style="width: 100%; height: 50%;"></div>