diff --git a/static/dev.html b/static/dev.html
index 4f24b11..4f8bcc9 100644
--- a/static/dev.html
+++ b/static/dev.html
@@ -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
}