2016-08-22 4 views

Antwort

0

obwohl html kann nicht für die Blase Text verwendet werden
können Sie die 'select' Veranstaltung nutzen Sie den Link Aktion

siehe folgende Arbeits Schnipsel ...

google.charts.load('current', { 
 
    callback: function() { 
 
    var data = google.visualization.arrayToDataTable([ 
 
     ['ID', 'Life Expectancy', 'Fertility Rate', 'Region',  'Population'], 
 
     ['CAN', 80.66,    1.67,  'North America', 33739900], 
 
     ['DEU', 79.84,    1.36,  'Europe',   81902307], 
 
     ['DNK', 78.6,    1.84,  'Europe',   5523095], 
 
     ['EGY', 72.73,    2.78,  'Middle East', 79716203], 
 
     ['GBR', 80.05,    2,   'Europe',   61801570], 
 
     ['IRN', 72.49,    1.7,  'Middle East', 73137148], 
 
     ['IRQ', 68.09,    4.77,  'Middle East', 31090763], 
 
     ['ISR', 81.55,    2.96,  'Middle East', 7485600], 
 
     ['RUS', 68.6,    1.54,  'Europe',   141850000], 
 
     ['USA', 78.09,    2.05,  'North America', 307007000] 
 
    ]); 
 

 
    var options = { 
 
     bubble: { 
 
     textStyle: { 
 
      fontSize: 11, 
 
      color: '#0000EE', 
 
      underline: true 
 
     } 
 
     }, 
 
     legend: { 
 
     position: 'bottom' 
 
     } 
 
    }; 
 

 
    var chart = new google.visualization.BubbleChart(document.getElementById('chart_div')); 
 

 
    google.visualization.events.addListener(chart, 'select', function() { 
 
     var selection = chart.getSelection(); 
 
     if (selection.length > 0) { 
 
     var url = 'https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q='; 
 
     var region = encodeURI(data.getValue(selection[0].row, 3)); 
 
     //window.open(url + region, '_blank'); 
 
     console.log(url + region); 
 
     } 
 
    }); 
 

 
    chart.draw(data, options); 
 
    }, 
 
    packages: ['corechart'] 
 
});
<script src="https://www.gstatic.com/charts/loader.js"></script> 
 
<div id="chart_div"></div>

+0

jede auszuführen Glück mit dieser Frage? – WhiteHat

Verwandte Themen