From b8f988e3d554163343178a0a52e980b3afa39015 Mon Sep 17 00:00:00 2001 From: Markus Grigull Date: Fri, 4 May 2018 13:03:26 +0200 Subject: [PATCH] Add proper margin to plot y-axis --- src/components/widget-plot/plot.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/widget-plot/plot.js b/src/components/widget-plot/plot.js index 702940d..a8e03f2 100644 --- a/src/components/widget-plot/plot.js +++ b/src/components/widget-plot/plot.js @@ -149,7 +149,7 @@ class Plot extends React.Component { // create scale functions for both axes const xScale = scaleTime().domain([Date.now() - this.props.time * 1000, Date.now()]).range([0, this.props.width - leftMargin - this.state.labelMargin - rightMargin]); - const yScale = scaleLinear().domain(yRange).range([this.props.height - bottomMargin, 0]); + const yScale = scaleLinear().domain(yRange).range([this.props.height - bottomMargin, 5]); const xAxis = axisBottom().scale(xScale).ticks(5).tickFormat(date => timeFormat("%M:%S")(date)); const yAxis = axisLeft().scale(yScale).ticks(5);