Added usage chart
This commit is contained in:
parent
1abb3b4716
commit
debffdf345
|
@ -73,6 +73,16 @@ export default {
|
||||||
text: 'Quantidade de clientes'
|
text: 'Quantidade de clientes'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
y1: {
|
||||||
|
beginAtZero: true,
|
||||||
|
min: 0,
|
||||||
|
|
||||||
|
position: 'right',
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: 'MB'
|
||||||
|
}
|
||||||
|
},
|
||||||
x: {
|
x: {
|
||||||
type: 'time',
|
type: 'time',
|
||||||
time: {
|
time: {
|
||||||
|
@ -95,12 +105,30 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
chartData() {
|
chartData() {
|
||||||
const pointRadius = 0
|
const pointRadius = 0
|
||||||
const borderWidth = 1
|
const borderWidth = 3
|
||||||
const tension = 0.2
|
const tension = 0.2
|
||||||
|
|
||||||
return {
|
return {
|
||||||
labels: this.stats.map(stat => new Date(stat.timestamp).getTime()),
|
labels: this.stats.map(stat => new Date(stat.timestamp).getTime()),
|
||||||
datasets: [
|
datasets: [
|
||||||
|
{
|
||||||
|
label: 'Uso médio de banda',
|
||||||
|
data: this.stats.map(stat => stat.avgUsage / 1024 / 1024),
|
||||||
|
|
||||||
|
borderColor: this.$vuetify.theme.isDark
|
||||||
|
? this.$vuetify.theme.themes.dark.error
|
||||||
|
: this.$vuetify.theme.themes.light.error,
|
||||||
|
|
||||||
|
backgroundColor: this.$vuetify.theme.isDark
|
||||||
|
? this.$vuetify.theme.themes.dark.error
|
||||||
|
: this.$vuetify.theme.themes.light.error,
|
||||||
|
borderWidth,
|
||||||
|
pointRadius,
|
||||||
|
|
||||||
|
cubicInterpolationMode: 'default',
|
||||||
|
tension,
|
||||||
|
yAxisID: 'y1'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Clientes conectados',
|
label: 'Clientes conectados',
|
||||||
data: this.stats.map(stat => stat.clients),
|
data: this.stats.map(stat => stat.clients),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user