Changeset bd8eeb4 in OpenWorkouts-current for ow/templates/profile.pt


Ignore:
Timestamp:
Jan 29, 2019, 12:35:08 PM (5 years ago)
Author:
borja <borja@…>
Branches:
current, feature/docs, master
Children:
d4cabcc, ed7e9d7
Parents:
6dc1846
Message:

(#7) Yearly (last 12 months) per month chart in the user profile

with filters to see the chart for distance, time or elevation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ow/templates/profile.pt

    r6dc1846 rbd8eeb4  
    8181      </div>
    8282
     83      <div class="month-stats js-month-stats">
     84        <svg width="600" height="300"></svg>
     85        <div class="filters js-filters">
     86          <a href="#" class="js-distance" i18n:translate="">distance</a>
     87          <a href="#" class="js-time" i18n:translate="">time</a>
     88          <a href="#" class="js-elevation" i18n:translate="">elevation</a>
     89        </div>
     90      </div>
     91
    8392    </div>
    8493
    8594  </metal:content>
    8695
     96  <metal:body-js metal:fill-slot="body-js">
     97
     98    <script src="${request.static_url('ow:static/components/d3/d3.min.js')}"></script>
     99    <script src="${request.static_url('ow:static/js/ow.js')}"></script>
     100
     101    <script type="text/javascript">
     102     var y_axis_labels = {
     103         "distance": "Kilometers",
     104         "time": "Hours",
     105         "elevation": "Meters"
     106     };
     107
     108     var year_chart = owjs.year_chart({
     109         chart_selector: 'div.js-month-stats svg',
     110         filters_selector: 'div.js-month-stats div.js-filters a',
     111         url: "${request.resource_url(context, 'yearly')}",
     112         current_month: "${current_month}",
     113         y_axis_labels: y_axis_labels,
     114     });
     115     year_chart.render("distance");
     116     year_chart.filters_setup();
     117    </script>
     118
     119  </metal:body-js>
     120
    87121</html>
Note: See TracChangeset for help on using the changeset viewer.