Skip to content

Commit

Permalink
FSR-1294 | Station Chart Label Wrapping (#821)
Browse files Browse the repository at this point in the history
* FSR-1294: Add logic to wrap text for the threshold label on the station chart

* Lint Fix
  • Loading branch information
Keyurx11 authored Oct 22, 2024
1 parent 4da173b commit 844d03c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/src/js/components/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,8 @@ function LineChart (containerId, stationId, data, options = {}) {
const textHeight = Math.round(text.node().getBBox().height)
path.attr('d', `m-0.5,-0.5 l${textWidth + 20},0 l0,${19 + textHeight} l-${((textWidth + 20) / 2) - 7.5},0 l-7.5,7.5 l-7.5,-7.5 l-${((textWidth + 20) / 2) - 7.5},0 l0,-${19 + textHeight} l0,0`)
label.attr('transform', `translate(${Math.round(width / 2 - ((textWidth + 20) / 2))}, -${29 + textHeight})`)

// Remove button
const remove = thresholdContainer.append('a')
.attr('role', 'button')
.attr('class', 'threshold__remove')
Expand Down

0 comments on commit 844d03c

Please sign in to comment.