diff --git a/sites/docs/pages/components/charts/small-multiple/index.md b/sites/docs/pages/components/charts/small-multiple/index.md new file mode 100644 index 0000000000..873c11d2cb --- /dev/null +++ b/sites/docs/pages/components/charts/small-multiple/index.md @@ -0,0 +1,60 @@ +--- +title: Small Multiple +description: Display a series of similar graphs or charts using the same scale and axes +sidebar_position: 96 +--- + +Use a small multiple to display a series of similar graphs or charts using the same scale and axes. +A small multiple can be created by using the grid, loop and query functions option in combination with a unique list of horizontal and vertical axes. + + 1. Define unique lists for axes + 2. Define grid + 3. Define loops for horizontal and/or veritical grid + 4. Filter chart value with query function + + +# Example + + +```sql categories +select distinct category as name from needful_things.orders +``` + +```sql orders_by_category +select category, order_month as month, sum(sales) as sales_usd0k, count(1) as orders from needful_things.orders +group by all +``` + + + + +{#each categories as category} + + +{/each} + + +```markdown + +{#each categories as category} + + +{/each} + +``` + + diff --git a/sites/docs/pages/core-concepts/filters/index.md b/sites/docs/pages/core-concepts/filters/index.md index 9e45cfe2c8..bd70b195ec 100644 --- a/sites/docs/pages/core-concepts/filters/index.md +++ b/sites/docs/pages/core-concepts/filters/index.md @@ -83,4 +83,21 @@ group by 1 x=month y=sales_usd /> -```` \ No newline at end of file +```` + +## Filtering a query with a search parameter in URL + +Every search parameter defined in the URL can be accessed and used as filter by using `{$page.url.searchParams.get('myParam')}` + +The search parameter should be defined as `.../pagename/?myParam=...` +``` + +``` + + + +URL parameters can be useful to share a specific page or present a view with predefined filters. + + + +