Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Fix issue with chart for weight entries that was clipping values

Roland Geider45169c73d0d2
diff --git a/manager/static/js/workout-manager.js b/manager/static/js/workout-manager.js
index 0ce7f0580..e8b2485a4 100644
--- a/manager/static/js/workout-manager.js
+++ b/manager/static/js/workout-manager.js
@@ -466,8 +466,8 @@ function weight_chart(data)
var minDate = getDate(data[0].x),
maxDate = getDate(data[data.length-1].x);
- var margin = {top: 10, right: 10, bottom: 150, left: 20},
- margin2 = {top: 290, right: 10, bottom: 50, left: 20},
+ var margin = {top: 10, right: 10, bottom: 150, left: 30},
+ margin2 = {top: 290, right: 10, bottom: 50, left: 30},
width = 600 - margin.left - margin.right,
height = 400 - margin.top - margin.bottom;
height2 = 390 - margin2.top - margin2.bottom;
@@ -537,9 +537,7 @@ function weight_chart(data)
var svg = d3.select("#weight_diagram").append("svg")
.datum(data)
.attr("width", width + margin.left + margin.right)
- .attr("height", height + margin.top + margin.bottom)
- .append("g")
- .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
+ .attr("height", height + margin.top + margin.bottom);
svg.append("defs").append("clipPath")
.attr("id", "clip")