рабочие графики на странице для разработчиков

This commit is contained in:
Vladislav Ostapov 2025-04-08 17:37:20 +03:00
parent 9c62810e8e
commit 1eaedeef0f

View File

@ -109,6 +109,37 @@
function updateHeaderHeight() { const header = document.querySelector('header'); document.body.style.setProperty('--header-height', `${header.offsetHeight}px`); }
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({
data() {
return {
@ -203,8 +234,8 @@
fill: false,
})
}
this.chart.datasets = datasets
this.chart.update()
MainChart.datasets = datasets
MainChart.update()
})
.catch((reason) => { alert(`Ошибка при чтении логов: ${reason}`) })
.finally(() => { this.submitStatus.logView = false })
@ -223,37 +254,6 @@
this.updateLoggingStatisticsSettings(vals)
}
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")
//this.chart = chart
}