score:1

Accepted answer

Assuming your data array looks something like this:

var dataArray = [{
  "City": "Chicago",
  "Airport": 80
},
{...}
]

you should be able to bind this data through its name easily, as with:

svg.selectAll("circle")
 .data(dataArray)          # or whatever name you have
 .attr('cx', function(d){ 
   return d.City;          # note that you need to use return
 }

If you can provide a bit more info about your dataset, it would be helpful.


Related Query