2025-08-14 15:49:46 -06:00

43 lines
628 B
Vue

<script setup>
import { Bar } from "vue-chartjs";
import {
Chart as ChartJS,
Title,
Tooltip,
Legend,
BarElement,
CategoryScale,
LinearScale,
} from "chart.js";
ChartJS.register(
Title,
Tooltip,
Legend,
BarElement,
CategoryScale,
LinearScale
);
const props = defineProps({
chartData: {
type: Object,
required: true,
},
chartOptions: {
type: Object,
default: () => ({
responsive: true,
scales: {
x: { stacked: true },
y: { stacked: true },
},
}),
},
});
</script>
<template>
<Bar :data="chartData" :options="chartOptions" />
</template>