From 33b30b4ced78db1265ebd4a90c2be96cab4f7778 Mon Sep 17 00:00:00 2001 From: kjgarza Date: Wed, 8 Apr 2020 10:52:26 +0200 Subject: [PATCH] change chart domain to last the whole year resolves: https://github.com/crosscite/doi-metadata-search/issues/162 --- public/javascripts/usage_bar_chart.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/javascripts/usage_bar_chart.js b/public/javascripts/usage_bar_chart.js index d19e810b..6db4c880 100644 --- a/public/javascripts/usage_bar_chart.js +++ b/public/javascripts/usage_bar_chart.js @@ -57,7 +57,7 @@ function setupCitations(data, yop, chartWidth) { var startDate = diff <= 20 ? yopDate : maxStart; var startTime = startDate; - var endTime = today; + var endTime = new Date(today.getFullYear(), 12, 0); var domain = [startTime, endTime]; var length = (diff > 20 ? 20 : diff) + 0.5; var firstLabel = formatYear(startDate); @@ -123,7 +123,6 @@ function bar2Viz(data, div, count, format, displayMode, yop) { } else { setup = setupUsage(data, yop, chartWidth); } - var x = d3.time.scale .utc() .domain(setup.domain)