i get the image URL from chart.getImageURI() function. but how can i automatically move to my local server folder when i run the php file without browser. i run the php file with command line.....in SSH.
can any one explain how can i do that. thanks in advance.
<script type="text/javascript">
google.charts.load("current", {packages:['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable(//jsonarray hear);
var options = {
title: 'Title of Graph',
curveType: 'function',
width: 800,
height: 400
};
var chart_div = document.getElementById('chart_div');
var chart = new google.visualization.LineChart(chart_div);
google.visualization.events.addListener(chart, 'ready', function () {
var imgURL = chart.getImageURI();
chart_div.innerHTML = '<img src="' + chart.getImageURI() + '">';
});
chart.draw(data, options);
}
</script>
<div id=\"chart_div\"></div>";
i added the script at top of my php file.
the graph are create and its work good. but i want this graph in png image file at my local server on specific folder. this PHP file not run in browser. its run in SSH as command line.so i want automatically save the chart in image.