From 60da695475d1853a32aa75ca71de421b70b51fa8 Mon Sep 17 00:00:00 2001 From: Vitalii Lysak Date: Tue, 26 Jul 2022 17:24:02 +0300 Subject: clean code for cpu dynamic --- src/components/_sila/Global/Chart.vue | 66 ++++++++++++++++++++++++----------- 1 file changed, 45 insertions(+), 21 deletions(-) (limited to 'src/components/_sila/Global') diff --git a/src/components/_sila/Global/Chart.vue b/src/components/_sila/Global/Chart.vue index 8cee2497..e0dfd952 100644 --- a/src/components/_sila/Global/Chart.vue +++ b/src/components/_sila/Global/Chart.vue @@ -50,6 +50,27 @@ export default { yMax: null, minTickInterval: null, plotBands: null, + plotLines: [ + { + color: '#E11717', + dashStyle: 'solid', + value: this.warning, + zIndex: '1000', + width: 2, + label: { + text: 'Пороговое значение предупреждения', + align: 'right', + style: { + fontFamily: 'Inter, sans-serif', + fontSize: '12px', + fontStyle: 'normal', + fontWeight: '400', + lineHeight: '16px', + color: '#0C1C2999', + }, + }, + }, + ], }; }, computed: { @@ -152,27 +173,7 @@ export default { minRange: this.minRange, minTickInterval: this.minTickInterval, minorGridLineColor: '#1A3E5B1A', - plotLines: [ - { - color: '#E11717', - dashStyle: 'solid', - value: this.warning, - zIndex: '1000', - width: 2, - label: { - text: 'Пороговое значение предупреждения', - align: 'right', - style: { - fontFamily: 'Inter, sans-serif', - fontSize: '12px', - fontStyle: 'normal', - fontWeight: '400', - lineHeight: '16px', - color: '#0C1C2999', - }, - }, - }, - ], + plotLines: this.plotLines, plotBands: this.plotBands, }, series: this.metricData.map((item) => ({ @@ -266,6 +267,29 @@ export default { this.yMax = 100; this.minTickInterval = 25; break; + case 'power': + this.categories = this.setCategories(101, 'Вт'); + this.yMax = 100; + this.minTickInterval = 25; + this.plotLines.push({ + color: '#1A3E5B', + dashStyle: 'solid', + value: this.shutdown, + width: 2, + label: { + text: 'Пороговое значения отказ', + align: 'right', + style: { + fontFamily: 'Inter', + fontSize: '12px', + fontStyle: 'normal', + fontWeight: '400', + lineHeight: '16px', + color: '#0C1C2999', + }, + }, + }); + break; } }, setCategories(count, desc) { -- cgit v1.2.3