diff --git a/apps/www/.vitepress/theme/style.css b/apps/www/.vitepress/theme/style.css index d8386c9f..71dad42e 100644 --- a/apps/www/.vitepress/theme/style.css +++ b/apps/www/.vitepress/theme/style.css @@ -28,6 +28,7 @@ --ring: 240 5% 64.9%; --radius: 0.5rem; + --vis-secondary-color: 160 81% 40%; --vis-font-family: inherit !important; --vis-area-stroke-width: 2px !important; --vis-donut-central-label-text-color: hsl(var(--muted-foreground)) !important; diff --git a/apps/www/src/content/docs/charts/area.md b/apps/www/src/content/docs/charts/area.md index ac22285c..abbaf504 100644 --- a/apps/www/src/content/docs/charts/area.md +++ b/apps/www/src/content/docs/charts/area.md @@ -4,8 +4,7 @@ description: Displays a callout for user attention. label: Alpha --- - - + ## Installation @@ -13,7 +12,6 @@ label: Alpha Only works with Vue >3.3 - ### Run the following command @@ -26,10 +24,11 @@ npx shadcn-vue@latest add chart-area Add the following tooltip styling to your `tailwind.css` file: -```css +```css @layer base { :root { /* ... */ + --vis-secondary-color: 160 81% 40%; --vis-tooltip-background-color: none !important; --vis-tooltip-border-color: none !important; --vis-tooltip-text-color: none !important; @@ -38,7 +37,5 @@ Add the following tooltip styling to your `tailwind.css` file: --vis-tooltip-padding: none !important; } ``` - + - - diff --git a/apps/www/src/content/docs/charts/bar.md b/apps/www/src/content/docs/charts/bar.md index 5c260a3e..095916e8 100644 --- a/apps/www/src/content/docs/charts/bar.md +++ b/apps/www/src/content/docs/charts/bar.md @@ -4,8 +4,7 @@ description: Displays a callout for user attention. label: Alpha --- - - + ## Installation @@ -25,10 +24,11 @@ npx shadcn-vue@latest add chart-bar Add the following tooltip styling to your `tailwind.css` file: -```css +```css @layer base { :root { /* ... */ + --vis-secondary-color: 160 81% 40%; --vis-tooltip-background-color: none !important; --vis-tooltip-border-color: none !important; --vis-tooltip-text-color: none !important; @@ -37,7 +37,5 @@ Add the following tooltip styling to your `tailwind.css` file: --vis-tooltip-padding: none !important; } ``` - + - - diff --git a/apps/www/src/content/docs/charts/donut.md b/apps/www/src/content/docs/charts/donut.md index 204b8e98..c8bb4b08 100644 --- a/apps/www/src/content/docs/charts/donut.md +++ b/apps/www/src/content/docs/charts/donut.md @@ -4,8 +4,7 @@ description: Displays a callout for user attention. label: Alpha --- - - + ## Installation @@ -13,7 +12,6 @@ label: Alpha Only works with Vue >3.3 - ### Run the following command @@ -26,10 +24,11 @@ npx shadcn-vue@latest add chart-donut Add the following tooltip styling to your `tailwind.css` file: -```css +```css @layer base { :root { /* ... */ + --vis-secondary-color: 160 81% 40%; --vis-tooltip-background-color: none !important; --vis-tooltip-border-color: none !important; --vis-tooltip-text-color: none !important; @@ -38,7 +37,5 @@ Add the following tooltip styling to your `tailwind.css` file: --vis-tooltip-padding: none !important; } ``` - + - - diff --git a/apps/www/src/content/docs/charts/line.md b/apps/www/src/content/docs/charts/line.md index a415433d..e0768147 100644 --- a/apps/www/src/content/docs/charts/line.md +++ b/apps/www/src/content/docs/charts/line.md @@ -4,8 +4,7 @@ description: Displays a callout for user attention. label: Alpha --- - - + ## Installation @@ -25,10 +24,11 @@ npx shadcn-vue@latest add chart-line Add the following tooltip styling to your `tailwind.css` file: -```css +```css @layer base { :root { /* ... */ + --vis-secondary-color: 160 81% 40%; --vis-tooltip-background-color: none !important; --vis-tooltip-border-color: none !important; --vis-tooltip-text-color: none !important; @@ -37,7 +37,5 @@ Add the following tooltip styling to your `tailwind.css` file: --vis-tooltip-padding: none !important; } ``` - + - - diff --git a/apps/www/src/lib/registry/default/ui/chart-area/AreaChart.vue b/apps/www/src/lib/registry/default/ui/chart-area/AreaChart.vue index 9b975ef9..3db304ba 100644 --- a/apps/www/src/lib/registry/default/ui/chart-area/AreaChart.vue +++ b/apps/www/src/lib/registry/default/ui/chart-area/AreaChart.vue @@ -77,6 +77,10 @@ const props = withDefaults(defineProps<{ showGradiant: true, }) +const emits = defineEmits<{ + legendItemClick: [d: BulletLegendItemInterface, i: number] +}>() + type KeyOfT = Extract type Data = typeof props.data[number] @@ -92,7 +96,7 @@ const legendItems = ref(props.categories.map((categ const isMounted = useMounted() function handleLegendItemClick(d: BulletLegendItemInterface, i: number) { - // do something when clicked on legend + emits('legendItemClick', d, i) } @@ -129,7 +133,9 @@ function handleLegendItemClick(d: BulletLegendItemInterface, i: number) { }" :opacity="legendItems.find(item => item.name === category)?.inactive ? filterOpacity : 1" /> + + +