%PDF- %PDF-
Direktori : /home/ugotscom/bos_naturals/resources/js/components/ |
Current File : /home/ugotscom/bos_naturals/resources/js/components/properties_bar.vue |
<script> import { Bar } from "vue-chartjs"; export default { props:['date1','date2'], extends: Bar, data() { return { url: "/dashboard/funnel", years: [], labels: ["Negotiation","Rejected","Won"], data: "", test:[], }; }, methods: { getProducts() { axios.get(this.url).then(response => { this.data = response.data; this.years.push(response.data.negotiation); this.years.push(response.data.rejected); this.years.push(response.data.won); if (this.data) { this.renderChart( { labels: this.labels, datasets: [ { label: "Rent", backgroundColor: 'rgb(125, 196, 128)', data: this.years }, { label:'', backgroundColor: 'rgba(255, 56, 96)', data: [] } ] }, { responsive: true, maintainAspectRatio: false, scales: { xAxes: [{ ticks: { maxRotation: 0, minRotation: 0 } }], yAxes: [{ ticks: { min: 0, max: 50, stepSize: 5, } }] } } ); } else { console.log("NO DATA"); } }); } }, mounted() { this.getProducts(); } }; </script>