%PDF- %PDF-
Direktori : /home/ugotscom/bos_naturals/resources/js/components/ |
Current File : /home/ugotscom/bos_naturals/resources/js/components/properties_bar_commercial.vue |
<script> import { Bar } from "vue-chartjs"; export default { extends: Bar, data() { return { url: "/properties/totalcount", years: [], labels: ["Offices","It Park","Retail","Land","Warehouse"], data: "", test:[], }; }, methods: { getProducts() { axios.get(this.url).then(response => { this.data = response.data; this.years.push(response.data.offices); this.years.push(response.data.itpark); this.years.push(response.data.retail); this.years.push(response.data.cland); this.years.push(response.data.warehouse); if (this.data) { this.renderChart( { labels: this.labels, datasets: [ { label: "Commercial Properties ", scale: 10, backgroundColor: [ 'rgb(255, 99, 132)', 'rgb(54, 162, 235)', 'rgb(255, 205, 86)' ], data: this.years } ] }, { responsive: true, maintainAspectRatio: false, scales: { xAxes: [{ ticks: { maxRotation: 90, minRotation: 80 } }], yAxes: [{ ticks: { min: 0, max: 50, stepSize: 10, } }] } } ); } else { console.log("NO DATA"); } }); } }, mounted() { this.getProducts(); } }; </script>