Skip to content

Commit 55f0e20

Browse files
committed
add doctab and change subtitle to category name
1 parent a5d4768 commit 55f0e20

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

  • sites/docs/pages/components/charts/small-multiple

sites/docs/pages/components/charts/small-multiple/index.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ A small multiple can be created by using the grid, loop and query functions opti
1515

1616
# Example
1717

18+
1819
```sql categories
1920
select distinct category as name from needful_things.orders
2021
```
@@ -24,22 +25,36 @@ select category, order_month as month, sum(sales) as sales_usd0k, count(1) as or
2425
group by all
2526
```
2627

28+
<DocTab>
29+
2730
<Grid cols=3 gapSize=lg>
2831
{#each categories as category}
2932

30-
3133
<LineChart
3234
data={orders_by_category.where(`category = '${category.name}'`)}
3335
x=month
3436
y=sales_usd0k
3537
yAxisTitle="Sales per Month"
3638
title="Monthly Sales"
37-
subtitle="Includes all categories"
39+
subtitle="{category.name}"
3840
/>
3941
{/each}
4042
</Grid>
4143

44+
```markdown
45+
<Grid cols=3 gapSize=lg>
46+
{#each categories as category}
4247

43-
44-
48+
<LineChart
49+
data={orders_by_category.where(`category = '${category.name}'`)}
50+
x=month
51+
y=sales_usd0k
52+
yAxisTitle="Sales per Month"
53+
title="Monthly Sales"
54+
subtitle="{category.name}"
55+
/>
56+
{/each}
57+
</Grid>
58+
```
59+
</DocTab>
4560

0 commit comments

Comments
 (0)