File tree Expand file tree Collapse file tree 4 files changed +43
-27
lines changed
visualization/stacked-bar-chart Expand file tree Collapse file tree 4 files changed +43
-27
lines changed Original file line number Diff line number Diff line change 1+ @mixin tooltip-styles {
2+ .has-tooltip {
3+ position : relative ;
4+
5+ & ::before {
6+ font-family : var (--font-family );
7+ content : attr (data-tooltip );
8+ position : absolute ;
9+ bottom : 110% ;
10+ left : 50% ;
11+ transform : translateX (-50% );
12+ background-color : var (--tooltip-background-color );
13+ color : var (--tooltip-text-color );
14+ padding : 6px 12px ;
15+ border-radius : 6px ;
16+ font-size : 13px ;
17+ line-height : 1.5 ;
18+ opacity : 0 ;
19+ visibility : hidden ;
20+ overflow : hidden ;
21+ white-space : nowrap ;
22+ transition :
23+ opacity 0.2s ease-in-out ,
24+ visibility 0.2s ease-in-out ;
25+ z-index : 10 ;
26+ display : block ;
27+ }
28+
29+ & .multiline-tooltip ::before {
30+ white-space : normal ;
31+ max-width : 400px ;
32+ }
33+
34+ & :hover ::before {
35+ opacity : 1 ;
36+ visibility : visible ;
37+ }
38+ }
39+ }
Original file line number Diff line number Diff line change 88 [style.width.%] ="asPercent(item.value) "
99 [style.background-color] ="item.color "
1010 (click) ="toggleDisplayMode() "
11- [attr.data -tooltip] ="showLegend() ? null : item.label "
12- >
11+ [class.has -tooltip] ="! showLegend() "
12+ [attr.data-tooltip] =" item.label " >
1313 {{ getItemDisplayValue(item) }}
1414 </ div >
1515 }
Original file line number Diff line number Diff line change 5151 & :hover {
5252 filter : brightness (1.1 );
5353 }
54-
55- & [data-tooltip ]::before {
56- content : attr (data-tooltip ); // Use a data attribute for the text
57- position : absolute ;
58- bottom : 110% ; // Position it above the segment
59- left : 50% ;
60- transform : translateX (-50% );
61- background-color : var (--tooltip-background-color );
62- color : var (--tooltip-text-color );
63- padding : 6px 12px ;
64- border-radius : 6px ;
65- font-size : 13px ;
66- white-space : nowrap ;
67- opacity : 0 ;
68- visibility : hidden ;
69- transition :
70- opacity 0.2s ease-in-out ,
71- visibility 0.2s ease-in-out ;
72- z-index : 10 ;
73- }
74-
75- & [data-tooltip ]:hover ::before {
76- opacity : 1 ;
77- visibility : visible ;
78- }
7954}
8055
8156.legend {
Original file line number Diff line number Diff line change 33@use ' ./app/shared/styles/callouts' ;
44@use ' ./app/shared/styles/cards' ;
55@use ' ./app/shared/styles/statuses' ;
6+ @use ' ./app/shared/styles/tooltip' ;
67
78@import url (' https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap' );
89
8081@include callouts .callout-styles ;
8182@include cards .card-styles ;
8283@include statuses .status-styles ;
84+ @include tooltip .tooltip-styles ;
8385
8486::view-transition-old(count),
8587::view-transition-new(count) {
You can’t perform that action at this time.
0 commit comments