Skip to content

Commit

Permalink
Fix range
Browse files Browse the repository at this point in the history
  • Loading branch information
emiliorizzo committed Jan 15, 2020
1 parent 271e412 commit d4dd857
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/vue-d3-barchart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,16 @@ export default {
xMax () {
return (this.getX) ? d3.max(this.xValues) : this.dataCount
},
xMin () {
return (this.getX) ? d3.min(this.xValues) : 0
},
scaleX () {
let { xMax, ww } = this
let { xMax, w, xMin } = this
let { padding } = this.opts
return d3.scaleBand()
.domain(d3.range(0, xMax + 1))
.domain(d3.range(xMin, xMax + 1))
.paddingInner(padding)
.rangeRound([0, ww])
.rangeRound([0, w])
},
scaleY () {
return d3.scaleLinear()
Expand Down

0 comments on commit d4dd857

Please sign in to comment.