【问题标题】:Highmaps add and join data from Google SpreadsheetHighmaps 添加和连接来自 Google 电子表格的数据
【发布时间】:2014-04-11 17:03:19
【问题描述】:

我无法从 Google 电子表格中获取我的数据以显示在我使用 highmaps 制作的地图上。我需要制作一个简单的美国地图叠加层,每个州有 2 个数据点。

数据点 #1 - 每个州的收入

这个将是颜色编码覆盖,从低于 100 万 -> 每个州超过 500 万

数据点 #2 - 每个州的职位

为此,我希望它在每个州显示工作编号。

到目前为止,这是我的代码:http://jsfiddle.net/abolotsko/v6KtZ/

$(function () {

    // Initiate the chart
    $('#container').highcharts('Map', {

        data: {
            googleSpreadsheetKey: '0AoIaUO7wH1HwdENPcGVEVkxfUDJkMmFBcXMzOVVPdHc'
        },
        chart: {
            borderWidth: 1
        },

        title: {
            text: 'Title'
        },

        legend: {
            layout: 'horizontal',
            borderWidth: 0,
            backgroundColor: 'rgba(255,255,255,0.85)',
            floating: true,
            verticalAlign: 'top',
            y: 25
        },

        title: {
            text: 'Estimated Economic Activity'
        },

        colorAxis: {
            min: 1,
            type: 'logarithmic',
            minColor: '#EEEEFF',
            maxColor: '#000022',
            stops: [
                [0, '#EFEFFF'],
                [0.67, '#4444FF'],
                [1, '#000022']
            ]
        },

        series: [{
            mapData: Highcharts.maps.us,
            name: 'World map',
            joinBy: 'code',
            dataLabels: {
                enabled: true,
                color: 'white',
                format: '{point.code}',
                style: {
                    fontWeight: 'bold',
                    textShadow: '0 0 3px black',
                    textTransform: 'uppercase'
                }
            },
            name: 'Jobs',
            tooltip: {
                pointFormat: '{point.code}: {point.value}'
            }
        }]
    });
});

这里是 Google 电子表格的链接:https://docs.google.com/spreadsheet/ccc?key=0AsGsaoYbU9OwdG1xeVc0b1Q5STFhQlg2WGFveHRkWnc

已解决-最终结果:http://jsfiddle.net/abolotsko/v6KtZ/ * 感谢 Paweł Fus

【问题讨论】:

    标签: jquery json highcharts spreadsheet


    【解决方案1】:

    您需要更改/添加两件事:

    【讨论】:

    • 谢谢!在 Highcharts 论坛上帮助我的人在哪里?
    • 谢谢。把这件事从我的待办事项清单中删除。接下来是将我们所有的 excel 电子表格移至 Google 文档并将它们连接到 Highcharts 3.0
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-14
    相关资源
    最近更新 更多