Skip to content

Commit

Permalink
fix(timeline-chart): Fixes an issue where the label of a key timing
Browse files Browse the repository at this point in the history
marker was cut off.

If a key timing marker was rendered too far to the right end of the
chart, the label associated with it was cut off by the container.
We introduced a threshold of 85%, at which point the label would be
rendered on the left hand side of the marker.

Fixes #495
  • Loading branch information
tomheller authored and thomaspink committed Jan 31, 2020
1 parent b55fa62 commit 36e6067
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/timeline-chart/src/timeline-chart.html
Expand Up @@ -34,6 +34,7 @@
<div class="dt-timeline-chart-key-timing-marker-container">
<div
class="dt-timeline-chart-key-timing-marker"
[ngClass]="{ 'dt-timeline-chart-key-timing-marker-label-left': markerObj.position > 85 }"
*ngFor="let markerObj of _renderKeyTimingMarkers"
[style.left.%]="markerObj.position"
[dtOverlay]="markerObj.marker._hasOverlay ? markerObj.marker._overlayTemplate : undefined"
Expand Down
6 changes: 6 additions & 0 deletions components/timeline-chart/src/timeline-chart.scss
Expand Up @@ -134,6 +134,12 @@ $dt-timeline-chart-marker-stroke-width-size: 2px;
color: $dt-timeline-chart-key-timing-marker-color;
}

.dt-timeline-chart-key-timing-marker-label-left
.dt-timeline-chart-key-timing-marker-label {
left: auto;
right: 12px;
}

.dt-timeline-chart-legend {
margin-top: 20px;
}
Expand Down

0 comments on commit 36e6067

Please sign in to comment.