从json文件而不是tsv filed3读取数据

时间:2013-10-13 10:31:05

标签: json d3.js tsv

这个多系列图从tsv文件中获取数据并绘制一个d3图http://bl.ocks.org/mbostock/3884955,在我的情况下,我的输入数据总是一个数组或一个json文件,所以我将data.tsv转换为一个json文件但我无法用jsn文件输入绘制图形。

[
{
"date":20111001,
"New York":63.4,
"San Francisco":62.7,
"Austin":72.2
},
{
"date":20111002,
"New York":58.0,
"San Francisco":59.9,
"Austin":67.7
},
{
"date":20111003,
"New York":53.3,
"San Francisco":59.1,
"Austin":69.4
},
{
"date":20111004,
"New York":55.7,
"San Francisco":58.8,
"Austin":68.0
},
{
"date":20111005,
"New York":64.2,
"San Francisco":58.7,
 "Austin":72.4
},
{
"date":20111006,
"New York":58.8,
"San Francisco":57.0,
"Austin":77.0
},
{
"date":20111007,
"New York":57.9,
"San Francisco":56.7,
"Austin":82.3
},
{
"date":20111008,
"New York":61.8,
"San Francisco":56.8,
"Austin":78.9
},
{
"date":20111009,
"New York":69.3,
"San Francisco":56.7,
"Austin":68.8
},
{
"date":20111010,
"New York":71.2,
"San Francisco":60.1,
"Austin":68.7
},
{
"date":20111011,
"New York":68.7,
"San Francisco":61.1,
"Austin":70.3
},
{
"date":20111012,
"New York":61.8,
"San Francisco":61.5,
"Austin":75.3
},
{
"date":20111013,
"New York":63.0,
"San Francisco":64.3,
"Austin":76.6
},
{
"date":20111014,
"New York":66.9,
"San Francisco":67.1,
"Austin":66.6
},
{
"date":20111015,
"New York":61.7,
"San Francisco":64.6,
"Austin":68.0
},
{
"date":20111016,
"New York":61.8,
"San Francisco":61.6,
"Austin":70.6
},
{
"date":20111017,
"New York":62.8,
"San Francisco":61.1,
"Austin":71.1
},
{
"date":20111018,
"New York":60.8,
"San Francisco":59.2,
"Austin":70.0
},
{
"date":20111019,
"New York":62.1,
"San Francisco":58.9,
"Austin":61.6
},
{
"date":20111020,
"New York":65.1,
"San Francisco":57.2,
"Austin":57.4
},
{
"date":20111021,
"New York":55.6,
"San Francisco":56.4,
"Austin":64.3
},
{
"date":20111022,
"New York":54.4,
"San Francisco":60.7,
"Austin":72.4
},
{
"date":20111023,
"New York":54.4,
"San Francisco":65.1,
"Austin":72.4
},
{
"date":20111024,
"New York":54.8,
"San Francisco":60.9,
"Austin":72.5
},
{
"date":20111025,
"New York":57.9,
"San Francisco":56.1,
"Austin":72.7
},
{
"date":20111026,
"New York":54.6,
"San Francisco":54.6,
"Austin":73.4
},
{
"date":20111027,
"New York":54.4,
"San Francisco":56.1,
"Austin":70.7
}
]

有什么想法吗?

0 个答案:

没有答案