Skip to content

Commit db47d00

Browse files
committed
WIP tooltipContent as snippet
1 parent 292143d commit db47d00

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/lib/components/data-vis/line-chart/ValueLabel.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@
4040
fill={labelTextColor}
4141
bind:contentRect={textDimensions}
4242
>
43-
{tooltipContent}
43+
{#if typeof tooltipContent === "string"}
44+
{tooltipContent}
45+
{:else}
46+
{@render tooltipContent()}
47+
{/if}
4448
</text>
4549
</g>
4650
</svg>

src/wrappers/components/data-vis/line-chart/line-chart/Examples.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
<CodeBlock code={codeBlocks.codeBlock1} language="svelte"></CodeBlock>
8181
{/snippet}
8282

83+
{#snippet ContentSnippet()}
84+
<p>Service update</p>
85+
{/snippet}
86+
8387
{#snippet Example4()}
8488
<div class="p-5 bg-white">
8589
<LineChart
@@ -88,6 +92,7 @@
8892
y="y"
8993
series="areaCode"
9094
basicLineParams={{ markers: true, interactive: true }}
95+
tooltipContent={ContentSnippet}
9196
></LineChart>
9297
</div>
9398
<CodeBlock code={codeBlocks.codeBlock1} language="svelte"></CodeBlock>

0 commit comments

Comments
 (0)