mirror of
				https://github.com/lingble/chatwoot.git
				synced 2025-11-03 20:48:07 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			63 lines
		
	
	
		
			993 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			993 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
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: () => {},
 | 
						|
    },
 | 
						|
  },
 | 
						|
  watch: {
 | 
						|
    collection() {
 | 
						|
      this.renderChart(this.collection, {
 | 
						|
        ...chartOptions,
 | 
						|
        ...this.chartOptions,
 | 
						|
      });
 | 
						|
    },
 | 
						|
  },
 | 
						|
  mounted() {
 | 
						|
    this.renderChart(this.collection, {
 | 
						|
      ...chartOptions,
 | 
						|
      ...this.chartOptions,
 | 
						|
    });
 | 
						|
  },
 | 
						|
};
 |