<script setup>
defineProps(['labels', 'datasets'])
import {ref} from 'vue';
import { Bar } from 'vue-chartjs';
import { Chart as ChartJS, Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale } from 'chart.js'
import { SessionUser } from "@/components/session/token/SessionUser.vue";


ChartJS.register(Title, Tooltip, Legend, BarElement, CategoryScale, LinearScale)

const chartOptions = {
  responsive: true,
  maintainAspectRatio: false
}

// Shortcut to statistics

// Set the time
SessionUser.adminUser.statistics.set_time('2024-01-01', '2024-12-31')



</script>

<template>
  <div>
    <Bar
        id="statistics-line"
        :options="chartOptions"
        :data="{
          labels: labels,
          datasets: datasets
        }"
    />
  </div>
</template>