Geochart: Tooltip without region name

18 views
Skip to first unread message

Pirate X

unread,
Apr 5, 2018, 7:04:38 AM4/5/18
to Google Visualization API


Code -

 function drawRegionsMap() {
    var data = new google.visualization.DataTable();
    data.addColumn('string', 'Województwo');
    data.addColumn('number', 'Frekwencja');
    data.addColumn({type: 'string', role: 'tooltip', p:{html:true}}, 'ToolTip');

    data.addRows( [
                  ['PL-DS', 60, '<p>Dolnośląskie</p>60%'],
                  ['PL-KP', 62, '<p>Kujawsko-Pomorskie</p>62%'], 
                  ['PL-LU', 59, '<p>Lubelskie</p>59%'], 
                  ['PL-LB', 61, '<p>Lubuskie</p>61%']
                  ])

    var options = {
        region: 'PL',
        resolution: 'provinces',
        datalessRegionColor: 'transparent',
        displayMode: 'regions',
        tooltip: {
            isHtml: true
        }
    };

    var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));

    chart.draw(data, options);
}

Output


Question -
How to remove the Region Name ?
If it is not recommended to remove the name, any documentation which says it's not possible/suggests workarounds ?
What's the best practice in this scenario ?
Reply all
Reply to author
Forward
0 new messages