-1
此腳本不加載任何數據。在mg表中加載json給出的數據未定義
<script lang="JavaScript">
d3.json('file:///C:/Software/Data/dirk/development/D3_TestLab/data/StatusTabel.json', function (error,data) {
console.log(JSON.stringify(data));
var table_data = data
var table1 = MG.data_table({
data: 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: 'Shift', label: 'Shift', width: 270, font_size: 14 })
.display();
})
</script>
我得到的錯誤:
TypeError: a.data is undefined.
誰能幫助我?
代碼標籤也請更具體你試圖做什麼你有什麼嘗試? – Tony
請合成你的代碼。 – pceccon
{「BU」:「過濾」,「線條」:400,「錯誤」:1,「Shift」:「Early」}, {「BU」:「過濾」,「線條」錯誤「:1,」Shift「:」遲到「} ] 這是我的JSON,但仍然沒有加載數據。 –