28 lines
1.2 KiB
Vue
28 lines
1.2 KiB
Vue
<script setup lang="ts">
|
|
import { BarChart } from '@/lib/registry/default/ui/chart-bar'
|
|
|
|
const data = [
|
|
{ name: 'Jan', total: Math.floor(Math.random() * 2000) + 500, predicted: Math.floor(Math.random() * 2000) + 500 },
|
|
{ name: 'Feb', total: Math.floor(Math.random() * 2000) + 500, predicted: Math.floor(Math.random() * 2000) + 500 },
|
|
{ name: 'Mar', total: Math.floor(Math.random() * 2000) + 500, predicted: Math.floor(Math.random() * 2000) + 500 },
|
|
{ name: 'Apr', total: Math.floor(Math.random() * 2000) + 500, predicted: Math.floor(Math.random() * 2000) + 500 },
|
|
{ name: 'May', total: Math.floor(Math.random() * 2000) + 500, predicted: Math.floor(Math.random() * 2000) + 500 },
|
|
{ name: 'Jun', total: Math.floor(Math.random() * 2000) + 500, predicted: Math.floor(Math.random() * 2000) + 500 },
|
|
{ name: 'Jul', total: Math.floor(Math.random() * 2000) + 500, predicted: Math.floor(Math.random() * 2000) + 500 },
|
|
]
|
|
</script>
|
|
|
|
<template>
|
|
<BarChart
|
|
index="name"
|
|
:data="data"
|
|
:categories="['total', 'predicted']"
|
|
:y-formatter="(tick, i) => {
|
|
return typeof tick === 'number'
|
|
? `$ ${new Intl.NumberFormat('us').format(tick).toString()}`
|
|
: ''
|
|
}"
|
|
:type="'stacked'"
|
|
/>
|
|
</template>
|