File tree Expand file tree Collapse file tree 1 file changed +19
-18
lines changed
src/lib/components/data-vis/line-chart Expand file tree Collapse file tree 1 file changed +19
-18
lines changed Original file line number Diff line number Diff line change 17
17
let horizontalPadding = $derived (verticalPadding * 2 );
18
18
</script >
19
19
20
- {#if tooltipSnippet === undefined }
21
- <div
22
- style =" position:absolute;
20
+ <div
21
+ style =" position:absolute;
23
22
top: {markerRect?.y - (textDimensions?.height ?? 0) - 15}px;
24
23
left: {markerRect?.x +
25
- (markerRect?.width ?? 0) / 2 -
26
- (textDimensions?.width ?? 0) / 2}px;
24
+ (markerRect?.width ?? 0) / 2 -
25
+ (textDimensions?.width ?? 0) / 2}px;
27
26
pointer-events: none;
28
- background-color: {labelColor};
27
+ "
28
+ >
29
+ {#if tooltipSnippet === undefined }
30
+ <div
31
+ style ="background-color: {labelColor };
29
32
padding: 5px;
30
- border-radius: 5px;
31
- height={textDimensions?.height ?? 0}
32
- width={textDimensions?.width ?? 0}"
33
- >
34
- <div bind:contentRect ={textDimensions }>{activeMarkerId .y }</div >
35
- </div >
36
- {:else }<div
37
- style ="position: absolute; top: {markerRect ?.y }px; left: {markerRect ?.x }px;"
38
- >
39
- {@render tooltipSnippet (activeMarkerId )}
40
- </div >
41
- {/if }
33
+ border-radius: 5px;"
34
+ >
35
+ <div bind:contentRect ={textDimensions }>{activeMarkerId .y }</div >
36
+ </div >
37
+ {:else }
38
+ <div bind:contentRect ={textDimensions }>
39
+ {@render tooltipSnippet (activeMarkerId )}
40
+ </div >
41
+ {/if }
42
+ </div >
You can’t perform that action at this time.
0 commit comments