I am creating a chart with nvd3. Since i am pretty new to javascript i've got a little problem assigning the chartdata. When i assign it like this:
var long_short_data = [
{
"key": "ISP",
"color": "#d62728",
"values": [
{
"label" : "oäop" ,
"value" : 9000
} ,...
]
},
{
"key": "Organization",
"color": "#d67548",
"values": [
{
"label" : "amklöericalököky" ,
"value" : 8000
},...
]
}
];
The graph is displayed as it should. But when i assign it like this:
var long_short_data = $.getJSON( "/link/to/multiBarHorizontalData.json", function() {
console.log( "success" );
})
It doesnt. These are my console logs:
success
nvd3.js:9229 Uncaught TypeError: data.map is not a function
Any help appreciated, thanks in advance