Chatwoot/app/javascript/dashboard/components/widgets/chart/HorizontalBarChart.js

55 lines
844 B
JavaScript
Raw Normal View History

2021-07-14 04:50:06 +00:00
import { HorizontalBar } from 'vue-chartjs';
const chartOptions = {
responsive: true,
legend: {
display: false,
},
title: {
display: false,
},
tooltips: {
enabled: false,
},
scales: {
xAxes: [
{
gridLines: {
offsetGridLines: false,
},
display: false,
stacked: true,
},
],
yAxes: [
{
gridLines: {
offsetGridLines: false,
},
display: false,
stacked: true,
},
],
},
};
export default {
extends: HorizontalBar,
props: {
collection: {
type: Object,
default: () => {},
},
chartOptions: {
type: Object,
default: () => {},
},
},
mounted() {
this.renderChart(this.collection, {
...chartOptions,
...this.chartOptions,
});
},
};