Vote count:
0
I'm playing around with d3.js and I ran into something weird.
When I change
var yScale = d3.scale.linear()
.domain([0, d3.max(data, function(d) { return d.Distance})])
.range([0, h])
to
var yScale = d3.scale.linear()
.domain([0, d3.max(data, function(d) { return d.Distance})])
.range([h, 0]) # CHANGED LINE
to get the axis to count in the right direction, one bar goes missing and the height of the remaining bars no longer corresponds with the value on the axis.
See here for a jsfiddle
I've checked the documentation and I can't find what I'm missing here. Any help would be greatly appreciated.
asked 32 secs ago
Losing bar when changing y-axis direction in d3.js
Aucun commentaire:
Enregistrer un commentaire