The Chart not showing up

42 views
Skip to first unread message

Yogie Putra

unread,
Aug 27, 2015, 1:29:46 AM8/27/15
to Google Visualization API
Hello Everyone,

So I came up from the simple line chart example and develop the code into this:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Visualization API Sample</title>
<!--
  One script tag loads all the required libraries! Do not specify any chart types in the
  autoload statement.
-->

<script type="text/javascript"
     
src='https://www.google.com/jsapi?autoload={
        "modules":[{
        "name":"visualization",
        "version":"1"
        }]
      }'
></script>
<script type="text/javascript">
  google
.setOnLoadCallback(drawVisualization);

 
function drawVisualization() {
   
var wrap = new google.visualization.ChartWrapper({
       
'chartType':'LineChart',
       
'dataSourceUrl':'http://amr2.mybluemix.net/getmet/list',
       
'containerId':'visualization',
       
'query':'SELECT currA,timetag',
       'options': {'title':'Example Chart', 'legend':'none'}
       
});
     wrap
.draw();
 
}
</script>
</head>
<body>
 
<div id="visualization" style="height: 400px; width: 400px;"></div>
</body>
</html>



My code doesn't work. Anybody can show me what I have been missing? 

Sergey Grabkovsky

unread,
Aug 27, 2015, 9:40:20 AM8/27/15
to Google Visualization API
Hi Yogie,

Your data doesn't appear to be formatted correctly. You can find the documentation for the DataTable JSON format here: https://developers.google.com/chart/interactive/docs/reference#dataparam

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/5e9736f7-d686-46f4-a70e-e9e894305ff5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages