Chatwoot/app/javascript/dashboard/components/widgets/chart/BarChart.js
Aswin Dev P.S 0ba6e772a4
feat: Display how many conversations are considered for the metric calculation (#4273)
* feat: Display how many conversations are considered for the metric calculation
2022-03-28 00:38:23 -07:00

62 lines
1 KiB
JavaScript

import { Bar } from 'vue-chartjs';
const fontFamily =
'-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif';
const defaultChartOptions = {
responsive: true,
maintainAspectRatio: false,
legend: {
labels: {
fontFamily,
},
},
datasets: {
bar: {
barPercentage: 1.0,
},
},
scales: {
xAxes: [
{
ticks: {
fontFamily,
},
gridLines: {
drawOnChartArea: false,
},
},
],
yAxes: [
{
ticks: {
fontFamily,
beginAtZero: true,
},
gridLines: {
drawOnChartArea: false,
},
},
],
},
};
export default {
extends: Bar,
props: {
collection: {
type: Object,
default: () => {},
},
chartOptions: {
type: Object,
default: () => {},
},
},
mounted() {
this.renderChart(this.collection, {
...defaultChartOptions,
...this.chartOptions,
});
},
};