Map Dashboard widget

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 4 months ago #21848

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.

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);
}

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #21852

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.

Please Log in or Create an account to join the conversation.

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 4 months ago #21857

Thanks, will investigate later.

Please Log in or Create an account to join the conversation.

  • Posts: 292
  • Thank you received: 5
  • Hikashop Business
13 years 4 months ago #21921

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.

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #21927

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...

Please Log in or Create an account to join the conversation.

Time to create page: 0.053 seconds
Powered by Kunena Forum