diff --git a/.gitignore b/.gitignore index f500cb576..2fd7a7bd4 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ test.db *.wpr .project .pydevproject +.vscode .settings .sass-cache .webassets-cache diff --git a/hasjob/models/jobpost.py b/hasjob/models/jobpost.py index 0e288eee8..4fd73a2e2 100644 --- a/hasjob/models/jobpost.py +++ b/hasjob/models/jobpost.py @@ -594,7 +594,7 @@ def viewstats_helper(jobpost_id, interval, limit, daybatch=False): for delta in range(batches): if daybatch: # here delta=0, so last item is the latest date/hour - cbuckets[batches - delta - 1] = (now_local - timedelta(days=delta)).strftime("%d-%m-%Y") + cbuckets[batches - delta - 1] = (now_local - timedelta(days=delta)).strftime("%b %d") else: from_hour = (now_local - timedelta(hours=delta)).strftime("%H:00") to_hour = (now_local - timedelta(hours=delta - 1)).strftime("%H:00") diff --git a/hasjob/templates/detail.html b/hasjob/templates/detail.html index b95c7b87a..a9f09dddd 100644 --- a/hasjob/templates/detail.html +++ b/hasjob/templates/detail.html @@ -468,7 +468,7 @@

A/B test results

c3.generate({ bindto: '#viewstats-chart', size: { - height: 150 + height: 200 }, data: { type: 'spline', @@ -487,7 +487,8 @@

A/B test results

}, axis: { x: { - type: 'category' + type: 'category', + height: 50 }, y: { tick: { format: d3.format("d") } @@ -495,6 +496,10 @@

A/B test results

} }); $('#viewstats').removeClass('hidden'); + // c3 initially draws the width too big, + // a window resize event forces it to redraw the chart properly + // http://stackoverflow.com/a/27180464/257944 + $(window).trigger('resize'); }) } {%- endif %}