Skip to content

Commit 5eb36aa

Browse files
committed
Fix bars pattern examples
1 parent b975567 commit 5eb36aa

2 files changed

Lines changed: 17 additions & 15 deletions

File tree

docs/src/examples/components/Bars/horizontal-highlight-individual-bar.svelte

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@
2727
<Layer>
2828
<Axis placement="bottom" grid rule />
2929
<Axis placement="left" rule />
30-
<Highlight
31-
data={data[3]}
32-
area={{ fill: 'url(#highlight-pattern)', class: 'stroke-secondary/50' }}
33-
/>
34-
<Pattern id="highlight-pattern" width={8} height={8}>
35-
<rect width={8} height={8} class="fill-secondary/10" />
36-
<line x1={8} y2={8} class="stroke-secondary/30" />
30+
<Pattern
31+
size={8}
32+
lines={{ rotate: -45, color: 'var(--color-secondary)', opacity: 0.3 }}
33+
background="color-mix(in oklab, var(--color-secondary) 10%, transparent)"
34+
>
35+
{#snippet children({ pattern })}
36+
<Highlight data={data[3]} area={{ fill: pattern, class: 'stroke-secondary/50' }} />
37+
{/snippet}
3738
</Pattern>
3839
<Bars strokeWidth={1} class="fill-primary" />
3940
</Layer>

docs/src/examples/components/Bars/vertical-highlight-individual-bar.svelte

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
<Layer>
2525
<Axis placement="left" grid rule />
2626
<Axis placement="bottom" rule />
27-
<Bars strokeWidth={1} class="fill-primary" />
28-
<Pattern id="highlight-pattern" width={8} height={8}>
29-
<rect width={8} height={8} class="fill-secondary/10" />
30-
<line x1={8} y2={8} class="stroke-secondary/30" />
27+
<Pattern
28+
size={8}
29+
lines={{ rotate: -45, color: 'var(--color-secondary)', opacity: 0.3 }}
30+
background="color-mix(in oklab, var(--color-secondary) 10%, transparent)"
31+
>
32+
{#snippet children({ pattern })}
33+
<Highlight data={data[3]} area={{ fill: pattern, class: 'stroke-secondary/50' }} />
34+
{/snippet}
3135
</Pattern>
32-
<Highlight
33-
data={data[3]}
34-
area={{ fill: 'url(#highlight-pattern)', class: 'stroke-secondary/50' }}
35-
/>
36+
<Bars strokeWidth={1} class="fill-primary" />
3637
</Layer>
3738
</Chart>

0 commit comments

Comments
 (0)