简体   繁体   中英

Google geo chart: tooltip: textStyle not working

I have the following code for a geo chart, where I've tried to specify the colour but the tooltip is showing up in a pale grey on a white background.

Any ideas?

I'm using chrome Version 32.0.1700.107 on a mac.

<script type='text/javascript' src='https://www.google.com/jsapi'></script>
    <script type='text/javascript'>
     google.load('visualization', '1', {'packages': ['geochart']});
     google.setOnLoadCallback(drawRegionsMap);

      function drawRegionsMap() {
        var data = google.visualization.arrayToDataTable([
        ['Country', 'Working days'],
        ['Greece', 243],
        ['Ireland', 205],
        ['United Kingdom', 162],
        ['Portugal',156],
        ['Belgium',164],
        ['Italy',166],
        ['Luxembourg',153],
        ['Cyprus',150],
        ['Finland',145],
        ['Austria',134],
        ['Norway',126],
        ['France',127],
        ['Netherlands',126],
        ['Denmark',122],
        ['Spain',125],
        ['Sweden',120],
        ['Czech Rep',164],
        ['Germany',119],
        ['Romania',110],
        ['Bulgaria',100],
        ['Lithuania',108],
        ['Slovakia',120],
        ['Slovenia',103],
        ['Estonia',79],
        ['Hungary',104],
        ['Latvia',73],
        ['Poland',70]
        ]);

        var options = {
        backgroundColor: '#DDDDDD',
        sizeAxis: { minValue: 0, maxValue: 250 },
        region: '150',
        datalessRegionColor: '#AAAAAA',
        tooltip: {textStyle: {color: '#444444'}, trigger:'hover'},
        colorAxis: {colors: ['green', 'blue']},
        legend: 'Days'
    };


        var chart = new google.visualization.GeoChart(document.getElementById('chart_div'));
        chart.draw(data, options);
    };
    </script>

I imagine there must be a way of fudging it to force the style to behave itself.

But if reimplementing the whole thing using completely different technology sounds in any way appealing... you could probably do something similar following this leaflet choropleth tutorial

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM