private static native void generateGraph(String stationName)/*-{
$wnd.google.load("visualization", "1.0", {
packages : [ 'corechart' ],
callback : drawVisualization
});
function drawVisualization() {
// Create and populate the data table.
var data = $wnd.google.visualization.arrayToDataTable(([
['Date', 'Score'],
<?php
$output = array ();
while($result = mysql_fetch_array($sql_data)) {
$t1 = strtotime($result['date']);
$t2 = date("d",$t1);
$output[] = "[".$t2.",".$result['sales']."]"; // note there is no comma at the end here }
echo implode(',', $output);
?>
]);
//
new $wnd.google.visualization.LineChart($wnd.document
.getElementById('visualization')).draw(data, {
title : stationName,
width : 600,
height : 400,
vAxis : {
title : "Year"
},
hAxis : {
title : "Sales"
}
});
}
}-*/;
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment