diff --git a/apps/www/src/content/docs/charts/guide.md b/apps/www/src/content/docs/charts/guide.md index 60c202f1..98f90cbd 100644 --- a/apps/www/src/content/docs/charts/guide.md +++ b/apps/www/src/content/docs/charts/guide.md @@ -41,3 +41,36 @@ Add the following tooltip styling to your `tailwind.css` file: ``` + +## Colors + +By default, we construct the primary theme color, and secondary (`--vis-secondary-color`) color with different opacity for the graph. + +However, you can always pass in the desired `color` into each chart. + +```vue + +``` + +## Custom tooltip + +If you want to customize the `Tooltip` for the chart, you can pass `customTooltip` prop with a custom Vue component. +The custom component would receive `title` and `data` props, check out [ChartTooltip.vue component](https://github.com/radix-vue/shadcn-vue/tree/dev/apps/www/src/lib/registry/default/ui/chart/ChartTooltip.vue) for example. + +The expecting prop definition would be + +```ts +defineProps<{ + title?: string + data: { + name: string + color: string + value: any + }[] +}>() +``` 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 723fcd52..6333b286 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 @@ -1,19 +1,28 @@