我有几个基本的本地 json 文件。我想使用敏锐的 io 可视化 json 数据。但不知何故,我无法将我的事件发送给敏锐。控制台中没有错误。
var client = new Keen({
projectId: "key",
writeKey: "key"
});
var data = $.getJSON( "data/web_stories.json", function( data ) {
var storyData = data
Keen.ready(function(){
var multipleEvents = {
"stories": data
};
// Send multiple events to several collections
client.addEvents(multipleEvents, function(err, res){
if (err) {
console.log('there is an error!')
}
else {
console.log('data sent')
}
数据看起来像这样
[
{ link: "www.link.com",
heading: 'here is the heading',
image: "www.image.com" },
{ link: "www.link.com",
heading: 'here is the heading',
image: "www.image.com" }
]