From 40b84d08f516b00e91e2a68d8d58a052ddd0f6c5 Mon Sep 17 00:00:00 2001 From: LeeGordon83 Date: Thu, 20 Jul 2023 15:07:11 +0100 Subject: [PATCH] threshold-label --- server/src/js/components/line-chart.js | 7 +++---- server/views/rainfall-station.html | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/server/src/js/components/line-chart.js b/server/src/js/components/line-chart.js index b38161184..946f33720 100644 --- a/server/src/js/components/line-chart.js +++ b/server/src/js/components/line-chart.js @@ -126,7 +126,7 @@ function LineChart (containerId, stationId, data, options = {}) { .attr('class', 'threshold__remove') .attr('tabindex', 0) .attr('data-threshold-remove', '') - .attr('aria-label', 'Remove threshold (Visual only)') + .attr('aria-label', `Remove ${threshold.level}m threshold (Visual only)`) .attr('aria-controls', `${containerId}-visualisation`) .attr('transform', 'translate(20,0)') remove.append('circle').attr('class', 'threshold__remove-bg').attr('r', 16).attr('x1', -5).attr('y1', -5) @@ -449,8 +449,7 @@ function LineChart (containerId, stationId, data, options = {}) { // const defaults = { - btnAddThresholdClass: 'defra-button-text-s', - btnAddThresholdText: 'Show on chart (Visual only)' + btnAddThresholdClass: 'defra-button-text-s' } options = Object.assign({}, defaults, options) @@ -514,7 +513,7 @@ function LineChart (containerId, stationId, data, options = {}) { document.querySelectorAll('[data-threshold-add]').forEach(container => { const button = document.createElement('button') button.className = options.btnAddThresholdClass - button.innerHTML = options.btnAddThresholdText + button.innerHTML = `Show ${container.getAttribute('data-level')}m threshold on chart (Visual only)` button.setAttribute('aria-controls', `${containerId}-visualisation`) button.setAttribute('data-id', container.getAttribute('data-id')) button.setAttribute('data-threshold-add', '') diff --git a/server/views/rainfall-station.html b/server/views/rainfall-station.html index ed5c10ede..dc338bec8 100644 --- a/server/views/rainfall-station.html +++ b/server/views/rainfall-station.html @@ -105,7 +105,7 @@

Rainfall over the last 5 days in millimetres

- Download data CSV (12KB) + Download data CSV (12KB)
{% endif %}