Skip to content

Commit ed72a4a

Browse files
committed
BarChart/sparkbars
- "Sparkbar-fixed-position tooltip" - use format so not so many decimals. - "sparkbar-within-a-paragraph-with-tooltip-and-highlight" - same reduction of decimals.
1 parent 9bdbc41 commit ed72a4a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

docs/src/examples/BarChart/sparkbar-fixed-position-tooltip.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
{format(data.date, 'day')}
3333
</div>
3434
<div class="font-semibold">
35-
{data.value}
35+
{format(data.value, 'decimal')}
3636
</div>
3737
{/snippet}
3838
</Tooltip.Root>

docs/src/examples/BarChart/sparkbar-within-a-paragraph-with-tooltip-and-highlight.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script lang="ts">
22
import { BarChart, Tooltip } from 'layerchart';
33
import { createDateSeries } from '$lib/utils/data.js';
4+
import { format } from '@layerstack/utils';
45
56
const data = createDateSeries({ count: 30, min: 20, max: 100 });
67
export { data };
@@ -26,7 +27,7 @@
2627
{#snippet children({ data })}
2728
<Tooltip.Header value={data.date} format="day" />
2829
<Tooltip.List>
29-
<Tooltip.Item label="value" value={data.value} />
30+
<Tooltip.Item label="value" value={format(data.value, 'decimal')} />
3031
</Tooltip.List>
3132
{/snippet}
3233
</Tooltip.Root>

0 commit comments

Comments
 (0)