1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/web/ synced 2025-03-09 00:00:01 +01:00

Add proper margin to plot y-axis

This commit is contained in:
Markus Grigull 2018-05-04 13:03:26 +02:00
parent 7c7c7cfb3f
commit b8f988e3d5

View file

@ -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);