data binding other than index

master
Matt Huntington 9 years ago
parent 9148e9ce13
commit 0d2c1b5284

@ -111,6 +111,15 @@ d3.selectAll('circle')//make a "ghost call" to all circles, even if there are no
.remove(); //removes those elements .remove(); //removes those elements
``` ```
To bind data to elements by something other than index:
```javascript
.data(data, function(d){
//match data based on d.id, not index
return d.id
});
```
## Linear Scale ## Linear Scale
A scale will map a data value to a visual value. A scale will map a data value to a visual value.

Loading…
Cancel
Save