%PDF- %PDF-
Direktori : /home/ugotscom/bos_naturals/resources/js/components/ |
Current File : /home/ugotscom/bos_naturals/resources/js/components/properties_bar2.vue |
<script> import { Bar } from "vue-chartjs"; export default { extends: Bar, data() { return { url: "/properties/totalcount", years: [], labels: ["Apartment","House","Gated","Land"], data: "", test:[], }; }, methods: { getProducts() { axios.get(this.url).then(response => { this.data = response.data; this.years.push(response.data.apartment); this.years.push(response.data.house); this.years.push(response.data.gated); this.years.push(response.data.rland); if (this.data) { this.renderChart( { labels: this.labels, datasets: [ { label: "Residential Properties ", backgroundColor: 'rgba(66, 141, 245)', data: this.years }, { label:'', backgroundColor: 'rgba(255, 56, 96)', data: [6, 5, 7, 2, 7] } ] }, { responsive: true, maintainAspectRatio: false, scales: { xAxes: [{ ticks: { maxRotation: 90, minRotation: 80 } }], yAxes: [{ ticks: { min: 0, max: 50, stepSize: 5, } }] } } ); } else { console.log("NO DATA"); } }); } }, mounted() { this.getProducts(); } }; </script>