使用FusionTables JSON作为Chart.js的输入

时间:2018-12-03 16:42:34

标签: javascript arrays json chart.js

我正在尝试使用Fusiontables响应来构建Chart.js图。 如何处理此响应以获取标签和数据? (如何访问此JSON中的数组?):

{
    "kind": "fusiontables#sqlresponse",
    "columns": ["KILOS", "REMISION"],
    "rows": [
        [9274.5, "405"],
        ["7371", "418"],
        ["5129", "429"],
        ["6759", "436"],
        [11185.5, "74"],
        ["7409", "447"],
        ["7931", "409"],
        ["5602", "420"],
        ["782", "426"],
        ["5699", "430"],
        [4565.5, "434"],
        [6695, "435"],
        [5930.7, "73"],
        [2631.5, "441"],
        ["6014", "411"],
        [7917.5, "452"],
        [7748.5, "461"],
        [7535.5, "467"],
        [7832.5, "465"],
        ["5694", "463"],
        [10009.4, "69"],
        ["7217", "475"],
        [7066.5, "446"],
        [9955.2, "427"],
        ["6635", "462"],
        ["6816", "431"],
        [7764.5, "444"],
        [8158.4, "495"],
        [5771.8, "499"],
        [7707.4, "494"],
        [7796.6, "496"],
        [9967.4, "510"],
        ["8247", "517"],
        [8095.2, "521"],
        [12918.6, "519"],
        [7633.8, "527"],
        [12648.6, "529"],
        [10622.4, "493"],
        [11243, "528"],
        [8989.2, "507"],
        [8420.2, "497"],
        [4900.6, "500"],
        [8086.4, "511"],
        [11814, "533"],
        [11228.2, "513"],
        [11008.8, "60"],
        [7064.4, "61"],
        [7385.6, "64"],
        [9597.3, "55"],
        ["10753", "52"],
        [6749.6, "59"],
        [9664.8, "6"],
        [9803.4, "9"]
    ]
}

0 个答案:

没有答案