Changeset 1fe89ea in OpenWorkouts-current for ow/static/js/ow.js
- Timestamp:
- Jan 29, 2019, 12:54:29 PM (5 years ago)
- Branches:
- current, feature/docs, master
- Children:
- 3e48af6
- Parents:
- d0fc76b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ow/static/js/ow.js
rd0fc76b r1fe89ea 148 148 */ 149 149 var chart = d3.select("svg"), 150 margin = {top: 20, right: 20, bottom: 30, left: 50},150 margin = {top: 17, right: 0, bottom: 20, left: 0}, 151 151 width = +chart.attr("width") - margin.left - margin.right, 152 152 height = +chart.attr("height") - margin.top - margin.bottom, … … 211 211 }) 212 212 .attr("y", function (d) { 213 return y(Number(d.distance) + 5); 214 }) 213 /* 214 Get the value for the current bar, then get the maximum 215 value to be displayed in the bar, which is used to 216 calculate the proper position of the label for this bar, 217 relatively to its height (1% above the bar) 218 */ 219 var max = y.domain()[1]; 220 return y(d.distance + y.domain()[1] * 0.02); 221 }) 215 222 .text(function(d) { 216 223 if (Number(d.distance) > 0) {
Note: See TracChangeset
for help on using the changeset viewer.