I am working on a parallel coordinate d3.js with d3.js and I am trying to build some data from an external json file.
Here's how the data in the json file is structured:
[ { "timestamp": 1437571117.035159, "dimension": 10, "value": [ { "value": 0.13347661474528993, "label": "A" }, { "value": 0.8677079004784608, "label": "B" }, { "value": 0.7757451827314333, "label": "C" }, { "value": 0.9614725817942508, "label": "D" }, { "value": 0.5259754037241577, "label": "E" } { "value": 0.9683208234943124, "label": "F" }, { "value": 0.9256394748794468, "label": "G" }, { "value": 0.8749624261426282, "label": "H" }, { "value": 0.6171642160674041, "label": "I" }, { "value": 0.9933299503850428, "label": "J" } ] } ]
And this is how I process the domain and how the graph displays the data of the elements:
d3.json("json/10dim.json", function(error, data) { if (error) {return console.log(error)}; x.domain(dimensions = d3.keys(data[2].value).filter(function(d) { return y[d] = d3.scale.linear() .domain(d3.extent(data, function(p) { return +p[d]; })) .range([height, 0]); })); etc...
The console does not give me any error, but neither the graphics nor the graphics are displayed correctly. This is jsfiddle with full code, and this is the link I used to encode this project.
Do you have an idea to solve this problem? Anyway, in advance for your answers!