Update Message.vue

This commit is contained in:
Troplo 2022-07-30 22:25:24 +10:00
parent 938b61a443
commit 90a267578a

View file

@ -236,7 +236,12 @@
<h3> <h3>
{{ graph.name }} {{ graph.name }}
</h3> </h3>
<p>Chart data could not be loaded.</p> <Chart
:chart-data="graph.data"
v-if="graph.data"
:options="graphOptions"
></Chart>
<p v-else>Chart data could not be loaded.</p>
</v-col> </v-col>
</v-row> </v-row>
<v-row <v-row
@ -655,7 +660,26 @@
<script> <script>
import CommsInput from "./CommsInput.vue" import CommsInput from "./CommsInput.vue"
import { Line as Chart } from "vue-chartjs/legacy"
import {
Chart as ChartJS,
Title,
Tooltip,
Legend,
CategoryScale,
LinearScale,
PointElement,
LineElement
} from "chart.js"
ChartJS.register(
Title,
Tooltip,
Legend,
CategoryScale,
LinearScale,
PointElement,
LineElement
)
export default { export default {
name: "Message", name: "Message",
props: [ props: [
@ -674,10 +698,18 @@ export default {
"deleteMessage" "deleteMessage"
], ],
components: { components: {
CommsInput CommsInput,
Chart
}, },
data() { data() {
return { return {
graphOptions: {
responsive: true,
maintainAspectRatio: false,
title: {
display: false
}
},
fileTypes: { fileTypes: {
png: "mdi-file-image", png: "mdi-file-image",
jpg: "mdi-file-image", jpg: "mdi-file-image",