我尝试使用 Peity.js 绘制条形图,并且成功了。我尝试使用metricsgraphics.js 绘制另一个图表,并且成功了。但是,当我组合它们时,它给了我错误:
Uncaught TypeError: Cannot read property 'DEFAULTS' of undefined (metricsgraphics.min.js:2)
你能帮我解决这个问题吗?
这是我的图表的metricsgraphics代码。当我添加它时,我得到了错误。
grapghData=
[
{ "date": "2014-04-23", "value": 115877608 },
{ "date": "2014-04-24", "value": 132088857 },
{ "date": "2014-04-25","value": 112071353 },
{ "date": "2014-04-26", "value": 81790062 },
{ "date": "2014-04-27", "value": 105003761 },
{ "date": "2014-04-28", "value": 100457727 },
{ "date": "2014-04-29", "value": 118253926 },
{ "date": "2014-04-30", "value": 67956992 }
];
grapghData = MG.convert.date(grapghData, 'date');
MG.data_graphic({
title: "Line Chart",
description: "This is a simple line chart. You can remove the area portion by adding area: false to the arguments list.",
data: grapghData,
width: 600,
height: 200,
right: 40,
target: document.getElementById('fake_users1'),
x_accessor: 'date',
y_accessor: 'value'
});