Skip to content

Commit

Permalink
Merge pull request #3 from smartcontractkit/169846445-Volatility-Y-va…
Browse files Browse the repository at this point in the history
…lue-is-getting-out-of-chart

Volatility Y value is getting out of chart
  • Loading branch information
hellobart authored and rupurt committed Jan 22, 2020
1 parent 6a75fb1 commit 4822dca
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions feeds-ui/src/components/deviationHistory/DeviationGraph.d3.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ export default class DeviationGraph {

bisectDate = d3.bisector(d => d.timestamp).left

nearest(n) {
return n < 0 ? Math.floor(n) : Math.round(n)
}

build() {
this.svg = d3
.select('.deviation-history-graph')
Expand Down Expand Up @@ -166,9 +162,12 @@ export default class DeviationGraph {
.domain(d3.extent(data, d => d.timestamp))
.range([0, this.width - this.margin.left])

const ymin = d3.min(data, d => d.deviation)
const ymax = d3.max(data, d => d.deviation)

this.y = d3
.scaleLinear()
.domain(d3.extent(data, d => this.nearest(d.deviation)))
.domain([Math.floor(ymin), Math.ceil(ymax)])
.range([this.height, 0])

const y_axis = d3
Expand Down

0 comments on commit 4822dca

Please sign in to comment.