This is my JSON data (this document is an external file and is called 'data.json')
[
{
"maand": "augustus 2014",
"weinigSlaap": "0.15",
"hogeStress": "0.1",
"langerReistijd": "0.12",
"hogeWerkdruk": "0.1",
"lageLiquiditeit": "0.1"
}
]
and I need it to become this with help of D3.
var data = [
[
{
axis: "Weinig slaap",
value: 0.15
}, {
axis: "Hoge stress",
value: 0.1
}, {
axis: "Lange reistijd",
value: 0.12
}, {
axis: "Hoge werkdruk",
value: 0.1
}, {
axis: "Lage liquiditeit",
value: 0.1
}
]
];
I'm stuck at this point and don't have any hope in live anymore ;)
d3.json('data.json', function (data) {
data.push(data);
console.log(data);
});