Map Dashboard widget
- brainforge
-
Topic Author
- Offline
Less
More
15 years 2 months ago #21848
by brainforge
Map Dashboard widget was created by brainforge
How can I debug what is going wrong with the widget?
No obvious Javascript errors or failed connections.
Looking at the page source I see the following Javascript function.
I would expect £37 to be be shown on the map when hovering over UK.
If I change showlegend to true I see a legend display showing £37.
No obvious Javascript errors or failed connections.
Looking at the page source I see the following Javascript function.
I would expect £37 to be be shown on the map when hovering over UK.
If I change showlegend to true I see a legend display showing £37.
Code:
google.load('visualization', '1', {'packages':['geomap']});
google.setOnLoadCallback(drawChart_5);
function drawChart_5() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Code');
data.addColumn('number', 'Sales');
data.addColumn('string', 'Country');
data.addRows(1);
data.setValue(0, 0, 'GB');
data.setValue(0, 1, 37);
data.setValue(0, 2, 'United Kingdom');
var options = {};
options['dataMode'] = 'regions';
options['width'] = '300px';
options['height'] = '210px';
options['showLegend'] = false;
options['region']='155';
var chart = new google.visualization.GeoMap(document.getElementById('graph_5'));
chart.draw(data, options);
}
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21852
by nicolas
Replied by nicolas on topic Re: Map Dashboard widget
So you mean that you don't see the hover ?
Because it works great on our end and the code you pasted in your message seems fine. Google has a playground where you can test the JS so you could try to test it there:
code.google.com/apis/ajax/playground/?ty...isualization#geo_map
Note that you will have to change a bit the js so that it uses the id of the HTML provided by google.
Because it works great on our end and the code you pasted in your message seems fine. Google has a playground where you can test the JS so you could try to test it there:
code.google.com/apis/ajax/playground/?ty...isualization#geo_map
Note that you will have to change a bit the js so that it uses the id of the HTML provided by google.
Please Log in or Create an account to join the conversation.
- brainforge
-
Topic Author
- Offline
15 years 2 months ago #21857
by brainforge
Replied by brainforge on topic Re: Map Dashboard widget
Thanks, will investigate later.
Please Log in or Create an account to join the conversation.
- brainforge
-
Topic Author
- Offline
15 years 2 months ago #21921
by brainforge
Replied by brainforge on topic Re: Map Dashboard widget
Turns out if I set the zone to All or Northern Europe the hover over works.
If I set it to Western Europe even though part of GB is shown the hover over does not work.
Really need some more options, like an all of Europe region, but Google don't appear to support that.
code.google.com/apis/chart/interactive/docs/gallery/geomap.html
I see there is a crude zoom-in feature together with zoomout / region click events which might be a way of providing a solution.
If I set it to Western Europe even though part of GB is shown the hover over does not work.
Really need some more options, like an all of Europe region, but Google don't appear to support that.
code.google.com/apis/chart/interactive/docs/gallery/geomap.html
I see there is a crude zoom-in feature together with zoomout / region click events which might be a way of providing a solution.
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21927
by nicolas
Replied by nicolas on topic Re: Map Dashboard widget
Indeed. The hover works only when the country is displayed in full. When cut, it's not displayed. The zoom in/out events might be a solution indeed but I don't see an easy way to implement it.
It would be so mcuh easier if google could display the hover even on cut countries. Maybe it would be worth asking them such feature...
It would be so mcuh easier if google could display the hover even on cut countries. Maybe it would be worth asking them such feature...
Please Log in or Create an account to join the conversation.
Time to create page: 0.179 seconds