График

This commit is contained in:
iriska-gri committed 2023-12-27 16:56:13 +03:00
1 parent 6ca56c6408
commit f699b4ffef
4 files changed
+66 -7

No files matched your search

@@ -0,0 +1,31 @@
<script>
import { Line } from 'vue-chartjs'
import { onMounted } from 'vue'
export default {
name: 'lineGraph',
components: {
Line
},
props: {
data: {
type: Object,
default: null
},
options: {
type: Object,
default: null
}
},
setup() {
onMounted(() => {
this.renderChart(this.data, this.options)
})
}
}
</script>
+32 -1
View File
@@ -1,18 +1,49 @@
<template>
<v-row>
<v-col
<!-- <v-col
class="text-h6 text-grey text-center align-self-center text--lighten-1 font-weight-light"
>
Об инспекции
</v-col> -->
<v-col>
<line-graph :data="data" :options="options"/>
</v-col>
</v-row>
</template>
<script>
import {pagecounter} from '@/utils/universal_functions'
import lineGraph from '@/components/graph/line-graph.vue'
export default {
components: { lineGraph },
setup(){
const data = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [
{
label: 'Data One',
backgroundColor: '#f87979',
data: [40, 39, 10, 40, 39, 80, 40]
}
]
}
const options = {
responsive: true,
maintainAspectRatio: false
}
pagecounter()
return {
data,
options
}
}
}
</script>