From 1eaedeef0fd837d24f5ba4779436889c063f5900 Mon Sep 17 00:00:00 2001 From: Vladislav Ostapov Date: Tue, 8 Apr 2025 17:37:20 +0300 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=87=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA=D0=B8=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D0=B5=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D1=80=D0=B0=D0=B7=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87?= =?UTF-8?q?=D0=B8=D0=BA=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/dev.html | 66 ++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) 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 }