Changeset 1fe89ea in OpenWorkouts-current for ow/static/js/ow.js


Ignore:
Timestamp:
Jan 29, 2019, 12:54:29 PM (5 years ago)
Author:
Segundo Fdez <segun.2@…>
Branches:
current, feature/docs, master
Children:
3e48af6
Parents:
d0fc76b
Message:

update dashboard layout ui

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/static/js/ow.js

    rd0fc76b r1fe89ea  
    148148         */
    149149        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},
    151151            width = +chart.attr("width") - margin.left - margin.right,
    152152            height = +chart.attr("height") - margin.top - margin.bottom,
     
    211211                })
    212212                .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            })
    215222                .text(function(d) {
    216223                    if (Number(d.distance) > 0) {
Note: See TracChangeset for help on using the changeset viewer.