diff --git a/apps/www/src/content/docs/charts/area.md b/apps/www/src/content/docs/charts/area.md index 6da49690..6c10af86 100644 --- a/apps/www/src/content/docs/charts/area.md +++ b/apps/www/src/content/docs/charts/area.md @@ -41,6 +41,6 @@ We can turn the chart into sparkline chart by hiding axis, gridline and legends. ### Custom Tooltip -If you want to render custom tooltip, you can easily pass in a custom component. Refer to prop definition [here](http://localhost:5173/docs/charts/guide.html#custom-tooltip). +If you want to render custom tooltip, you can easily pass in a custom component. Refer to prop definition [here](/docs/charts/guide.html#custom-tooltip). diff --git a/apps/www/src/content/docs/charts/bar.md b/apps/www/src/content/docs/charts/bar.md index 40e86efe..ddce7edf 100644 --- a/apps/www/src/content/docs/charts/bar.md +++ b/apps/www/src/content/docs/charts/bar.md @@ -27,4 +27,24 @@ Follow the [guide](/docs/charts/guide.html#installation) to complete the setup. +## API + + +## Example + +### Stacked + +You can stack the bar chart by settings prop `type` to `stacked`. + + + +### Rounded + + + +### Custom Tooltip + +If you want to render custom tooltip, you can easily pass in a custom component. Refer to prop definition [here](/docs/charts/guide.html#custom-tooltip). + + diff --git a/apps/www/src/content/docs/charts/donut.md b/apps/www/src/content/docs/charts/donut.md index 236eecad..607c45b7 100644 --- a/apps/www/src/content/docs/charts/donut.md +++ b/apps/www/src/content/docs/charts/donut.md @@ -27,4 +27,26 @@ Follow the [guide](/docs/charts/guide.html#installation) to complete the setup. +## API + + +## Example + +### Pie Chart + +If you want to render pie chart instead, pass `type` as `pie`. + + + +### Color + +We generate colors automatically based on the primary and secondary color and assigned them accordingly. Feel free to pass in your own array of colors. + + + +### Custom Tooltip + +If you want to render custom tooltip, you can easily pass in a custom component. Refer to prop definition [here](/docs/charts/guide.html#custom-tooltip). + + diff --git a/apps/www/src/content/docs/charts/line.md b/apps/www/src/content/docs/charts/line.md index 47f130db..7e965ad3 100644 --- a/apps/www/src/content/docs/charts/line.md +++ b/apps/www/src/content/docs/charts/line.md @@ -29,7 +29,7 @@ Follow the [guide](/docs/charts/guide.html#installation) to complete the setup. ## API - + ## Example @@ -41,6 +41,6 @@ We can turn the chart into sparkline chart by hiding axis, gridline and legends. ### Custom Tooltip -If you want to render custom tooltip, you can easily pass in a custom component. Refer to prop definition [here](http://localhost:5173/docs/charts/guide.html#custom-tooltip). +If you want to render custom tooltip, you can easily pass in a custom component. Refer to prop definition [here](/docs/charts/guide.html#custom-tooltip). diff --git a/apps/www/src/lib/registry/default/example/BarChartCustomTooltip.vue b/apps/www/src/lib/registry/default/example/BarChartCustomTooltip.vue new file mode 100644 index 00000000..c450772b --- /dev/null +++ b/apps/www/src/lib/registry/default/example/BarChartCustomTooltip.vue @@ -0,0 +1,28 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/BarChartRounded.vue b/apps/www/src/lib/registry/default/example/BarChartRounded.vue new file mode 100644 index 00000000..cb3d6226 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/BarChartRounded.vue @@ -0,0 +1,27 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/BarChartStacked.vue b/apps/www/src/lib/registry/default/example/BarChartStacked.vue new file mode 100644 index 00000000..b2e7d185 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/BarChartStacked.vue @@ -0,0 +1,27 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/DonutChartColor.vue b/apps/www/src/lib/registry/default/example/DonutChartColor.vue new file mode 100644 index 00000000..0ae5b157 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/DonutChartColor.vue @@ -0,0 +1,24 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/DonutChartCustomTooltip.vue b/apps/www/src/lib/registry/default/example/DonutChartCustomTooltip.vue new file mode 100644 index 00000000..2e927858 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/DonutChartCustomTooltip.vue @@ -0,0 +1,22 @@ + + + diff --git a/apps/www/src/lib/registry/default/example/DonutChartPie.vue b/apps/www/src/lib/registry/default/example/DonutChartPie.vue new file mode 100644 index 00000000..cf3de170 --- /dev/null +++ b/apps/www/src/lib/registry/default/example/DonutChartPie.vue @@ -0,0 +1,21 @@ + + + diff --git a/apps/www/src/lib/registry/default/ui/chart-bar/BarChart.vue b/apps/www/src/lib/registry/default/ui/chart-bar/BarChart.vue index a5d5cdfb..31cd512f 100644 --- a/apps/www/src/lib/registry/default/ui/chart-bar/BarChart.vue +++ b/apps/www/src/lib/registry/default/ui/chart-bar/BarChart.vue @@ -33,7 +33,6 @@ const props = withDefaults(defineProps & { showLegend: true, showGridLine: true, }) - const emits = defineEmits<{ legendItemClick: [d: BulletLegendItemInterface, i: number] }>() @@ -61,14 +60,14 @@ const selectorsBar = computed(() => props.type === 'grouped' ? GroupedBar.select