Changeset 4bab6c1 in OpenWorkouts-current


Ignore:
Timestamp:
Jan 29, 2019, 12:02:12 PM (4 years ago)
Author:
borja <borja@…>
Branches:
current, feature/docs, master
Children:
bed4f06
Parents:
7783f97
Message:

Use the chart_selector variable when looking for the element where the week chart

will be rendered (instead of the hardcoded "svg")

Location:
ow
Files:
2 edited

Legend:

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

    r7783f97 r4bab6c1  
    3131    var openstreetmap_attr = 'Map data &copy; <a href="http://www.osm.org">OpenStreetMap</a>';
    3232
    33     // Some constants reused through the code
     33    // Some vars reused through the code
    3434    var map;
    3535    var gpx;
     
    147147           Build a d3 bar chart, populated with data from the given url.
    148148         */
    149         var chart = d3.select("svg"),
     149        var chart = d3.select(chart_selector),
    150150            margin = {top: 20, right: 20, bottom: 30, left: 50},
    151151            width = +chart.attr("width") - margin.left - margin.right,
  • ow/templates/dashboard.pt

    r7783f97 r4bab6c1  
    211211    <script type="text/javascript">
    212212     var week_chart = owjs.week_chart({
    213          chart_selector: 'div.js-week-stats',
     213         chart_selector: 'div.js-week-stats svg',
    214214         url: "${request.resource_url(context, 'week')}",
    215215         current_day_name: "${current_day_name}"
Note: See TracChangeset for help on using the changeset viewer.