on 06-02-2015 12:17 AM
Hi,
I am trying to integrate Google geochart in my SAPUI5 application. I have followed the steps provided in the official documentation (https://developers.google.com/chart/interactive/docs/gallery/geochart).
When I tried to execute the application, I have received the following error.
"Uncaught TypeError: Cannot read property 'arrayToDataTable' of undefined"
I have tried several ways to load the google api and chart but nothing worked.
Please help me if you are aware of this issue.
Hi Anson,
I used like this and it's working.
I just created index.html.
Please take a look.
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<script src="resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons"
data-sap-ui-theme="sap_bluecrystal">
</script>
<!-- add sap.ui.table,sap.ui.ux3 and/or other libraries to 'data-sap-ui-libs' if required -->
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['geochart']}]}"></script>
<script>
google.load("visualization", "1", {packages:["geochart"]});
google.setOnLoadCallback(drawRegionsMap);
function drawRegionsMap() {
var data = google.visualization.arrayToDataTable([
['Country', 'Popularity'],
['Germany', 200],
['United States', 300],
['Brazil', 400],
['Canada', 500],
['France', 600],
['RU', 700]
]);
var options = {};
var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
chart.draw(data, options);
//chart.placeAt("content");
}
</script>
</head>
<body class="sapUiBody" role="application">
<div id="regions_div" style="width: 900px; height: 500px;"></div>
</body>
</html>
Regards
Dhananjay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.