Skip to content

Instantly share code, notes, and snippets.

@nidhi-canopas
Last active August 16, 2022 06:23
Show Gist options
  • Select an option

  • Save nidhi-canopas/b905e8c66f5bb877e46ed9dec5f2836a to your computer and use it in GitHub Desktop.

Select an option

Save nidhi-canopas/b905e8c66f5bb877e46ed9dec5f2836a to your computer and use it in GitHub Desktop.
<template>
<Bar :chart-data="chartData" />
</template>
<script >
const chartData = {
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"],
datasets: [
{
label: "Dataset 1",
data: [2, 5, 4, 8, 10, 4, 7],
backgroundColor: "#DB4C77",
},
],
};
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
);
export default {
components: {
Bar,
},
data() {
return {
chartData: chartData,
};
},
};
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment