diff options
author | Martin Wright <martin@mysociety.org> | 2018-03-28 15:24:21 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-04-06 17:43:30 +0100 |
commit | 2a569a3b42465cfb51ae5073d6885ed758072ecf (patch) | |
tree | 64da2244b9f79f214eecfc325954e642838d99a8 | |
parent | b02794bd4f3070d302a965cd2b9e04d430a7cddc (diff) |
No longer horizontally align label with JS.
Fixes positioning bugs in all versions of IE due
to calculating the wrong horizontal position.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | web/cobrands/sass/_dashboard.scss | 4 | ||||
-rw-r--r-- | web/js/dashboard.js | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d973a8c8..4f0a20f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ - Stop race condition when making a new report quickly. - Set a session timezone in case database server is set differently. - Fix SQL error on update edit admin page in cobrands. #2049 + - Improve chart display in old IE versions. #2005 - Admin improvements: - Inspectors can set non_public status of reports. #1992 - Default start date is shown on the dashboard. diff --git a/web/cobrands/sass/_dashboard.scss b/web/cobrands/sass/_dashboard.scss index 0fbff88e9..6867e0be4 100644 --- a/web/cobrands/sass/_dashboard.scss +++ b/web/cobrands/sass/_dashboard.scss @@ -98,6 +98,8 @@ position: absolute; margin-top: -1em; margin-#{$right}: 0; + right: 0; + width: 18%; // 20% padding from .labelled-line-chart, 2% gutter } } @@ -348,4 +350,4 @@ margin-#{$right}: 1.5em !important; } } -}
\ No newline at end of file +} diff --git a/web/js/dashboard.js b/web/js/dashboard.js index 1f7f7c3e5..82b5e6188 100644 --- a/web/js/dashboard.js +++ b/web/js/dashboard.js @@ -27,7 +27,6 @@ $(function(){ var setUpLabelsForChart = function(chart){ var $parent = $(chart.chart.canvas).parent(); - var xGutterInPixels = 30; var lasty = 0; $.each(chart.config.data.datasets, function(datasetIndex, dataset){ @@ -38,8 +37,7 @@ $(function(){ y = lasty; } $label.css({ - top: y, - left: latestPoint._model.x + xGutterInPixels + top: y }); lasty = y + $label.height() + 8; }); |