рабочие графики на странице для разработчиков
This commit is contained in:
parent
9c62810e8e
commit
1eaedeef0f
@ -109,6 +109,37 @@
|
|||||||
function updateHeaderHeight() { const header = document.querySelector('header'); document.body.style.setProperty('--header-height', `${header.offsetHeight}px`); }
|
function updateHeaderHeight() { const header = document.querySelector('header'); document.body.style.setProperty('--header-height', `${header.offsetHeight}px`); }
|
||||||
window.addEventListener('load', updateHeaderHeight); window.addEventListener('resize', updateHeaderHeight);
|
window.addEventListener('load', updateHeaderHeight); window.addEventListener('resize', updateHeaderHeight);
|
||||||
|
|
||||||
|
let MainChart = new Chart(document.getElementById('mainChart').getContext('2d'), {
|
||||||
|
type: 'line',
|
||||||
|
data: {
|
||||||
|
datasets: []
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
responsive: true,
|
||||||
|
scales: {
|
||||||
|
x: {
|
||||||
|
type: 'time',
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: 'Время',
|
||||||
|
font: {
|
||||||
|
padding: 4,
|
||||||
|
size: 20,
|
||||||
|
weight: 'bold',
|
||||||
|
family: 'Arial'
|
||||||
|
},
|
||||||
|
//color: 'darkblue'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
y: {
|
||||||
|
beginAtZero: true,
|
||||||
|
type: 'linear',
|
||||||
|
position: 'left'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const app = Vue.createApp({
|
const app = Vue.createApp({
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -203,8 +234,8 @@
|
|||||||
fill: false,
|
fill: false,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.chart.datasets = datasets
|
MainChart.datasets = datasets
|
||||||
this.chart.update()
|
MainChart.update()
|
||||||
})
|
})
|
||||||
.catch((reason) => { alert(`Ошибка при чтении логов: ${reason}`) })
|
.catch((reason) => { alert(`Ошибка при чтении логов: ${reason}`) })
|
||||||
.finally(() => { this.submitStatus.logView = false })
|
.finally(() => { this.submitStatus.logView = false })
|
||||||
@ -223,37 +254,6 @@
|
|||||||
this.updateLoggingStatisticsSettings(vals)
|
this.updateLoggingStatisticsSettings(vals)
|
||||||
}
|
}
|
||||||
doFetchSettings().then(() => {})
|
doFetchSettings().then(() => {})
|
||||||
let chart = new Chart(document.getElementById('mainChart').getContext('2d'), {
|
|
||||||
type: 'line',
|
|
||||||
data: {
|
|
||||||
datasets: []
|
|
||||||
},
|
|
||||||
options: {
|
|
||||||
responsive: true,
|
|
||||||
scales: {
|
|
||||||
x: {
|
|
||||||
type: 'time',
|
|
||||||
title: {
|
|
||||||
display: true,
|
|
||||||
text: 'Время',
|
|
||||||
font: {
|
|
||||||
padding: 4,
|
|
||||||
size: 20,
|
|
||||||
weight: 'bold',
|
|
||||||
family: 'Arial'
|
|
||||||
},
|
|
||||||
//color: 'darkblue'
|
|
||||||
},
|
|
||||||
},
|
|
||||||
y: {
|
|
||||||
beginAtZero: true,
|
|
||||||
type: 'linear',
|
|
||||||
position: 'left'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
this.chart = chart
|
|
||||||
document.getElementById("app").removeAttribute("hidden")
|
document.getElementById("app").removeAttribute("hidden")
|
||||||
//this.chart = chart
|
//this.chart = chart
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user