【发布时间】:2015-07-27 05:55:56
【问题描述】:
我是 D3.js 的新手。 我创建了一个脚本,但我无法将任何 json 数据加载到我的表中。
d3.json('C:\Software\Data\dirk\development\D3_TestLab\data\StatusTabel.json', function (data) {
var table_data = data
var table1 = MG.data_table({
data: table_data,
//title: '',
//description: 'A table has many of the same properties as any other data graphic.',
show_tooltips: true
})
.target('#div1')
.number({ accessor: 'BU', label: 'BU', width: 120, font_size: 14, layout: 'center' })
.number({ accessor: 'Lines', label: '# Lines', width: 190, font_size: 14, layout: 'center' })
//.number({accessor: 'Errors', label: 'Errors', width: 170, font_size: 14, color: function(d){ return d > 0 ? '#f70101' : 'auto'; })
.number({ accessor: 'Errors', label: 'Errors', width: 190, font_size: 14, color: 'red', allign: 'center' })
.number({ accessor: 'Shift', label: 'Shift', width: 270, font_size: 14 })
.display();
})
【问题讨论】:
标签: javascript html json d3.js