score:1

Accepted answer

NVD3 expects data to be in this format:

[
  {
     key: 'my dataset',
     values: [...]
  }
]

You could do:

const processedData = [{
   key: 'my dataset',
   values: data
}];

d3.select('#container svg')
    .datum(processedData)
    .call(chart);

Related Query