-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2816 from evidence-dev/fix/2800-seriesFMT
seriesFmt for series labels in charts
- Loading branch information
Showing
23 changed files
with
245 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@evidence-dev/core-components': patch | ||
--- | ||
|
||
series names can be formatted in Area, Bar, Bubble, Line charts and Scatter plot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
packages/ui/core-components/src/lib/unsorted/viz/core/Chart.stories.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script context="module"> | ||
/** @type {import("@storybook/svelte").Meta}*/ | ||
export const meta = { | ||
title: 'Charts/Chart', | ||
component: Chart | ||
}; | ||
</script> | ||
|
||
<script> | ||
import { Story } from '@storybook/addon-svelte-csf'; | ||
import { Query } from '@evidence-dev/sdk/usql'; | ||
import { query } from '@evidence-dev/universal-sql/client-duckdb'; | ||
import Chart from './Chart.svelte'; | ||
import Bar from '../bar/Bar.svelte'; | ||
import Line from '../line/Line.svelte'; | ||
</script> | ||
|
||
<Story name="Base"> | ||
{@const data = Query.create( | ||
`SELECT 1 AS x, 5 AS growth, 50 AS size, 0.1 AS seriesA, 0.7 AS seriesB | ||
UNION | ||
SELECT 2 AS x, 10 AS growth, 60 AS size, 0.1 AS seriesA, 0.7 AS seriesB | ||
UNION | ||
SELECT 3 AS x, 20 AS growth, 70 AS size, 0.1 AS seriesA, 0.7 AS seriesB | ||
UNION | ||
SELECT 4 AS x, 30 AS growth, 90 AS size, 0.1 AS seriesA, 0.7 AS seriesB | ||
UNION | ||
SELECT 5 AS x, 40 AS growth, 110 AS size, 0.1 AS seriesA, 0.7 AS seriesB | ||
UNION | ||
SELECT 6 AS x, 50 AS growth, 130 AS size, 0.1 AS seriesA, 0.7 AS seriesB`, | ||
query | ||
)} | ||
<Chart {data} title="Growth vs Sales"> | ||
<Bar y="growth" series="seriesA" seriesLabelFmt="pct" /> | ||
<Line y="size" series="seriesB" seriesLabelFmt="pct" /> | ||
</Chart> | ||
</Story> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.