Skip to content

Commit 24bfc58

Browse files
author
Kathryn Dale
committed
Make font size dynamic
1 parent 143e402 commit 24bfc58

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

metrics/interfaces/charts/common/chart_output.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ def _apply_watermark(self) -> None:
4444
watermark_text = DataClassification[self.data_classification].value
4545

4646
width = self.figure.layout.width or 800
47+
48+
max_font_size = int((width * 0.9) / (len(watermark_text) * 0.5))
4749

48-
WATERMARK_FONT_SIZE = max(20, int(width * 0.07))
49-
50+
WATERMARK_FONT_SIZE = max(12, min(max_font_size, 100))
5051

5152
self.figure.add_annotation(
5253
text=watermark_text,

0 commit comments

Comments
 (0)