From 59d971b503feaf81037fb5215560990fb28adc39 Mon Sep 17 00:00:00 2001 From: zakhy Date: Wed, 29 May 2024 12:04:46 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=BA?= =?UTF-8?q?=D1=80=D1=83=D0=B3=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=B4=D0=B8=D0=B0?= =?UTF-8?q?=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D1=8B=20=D0=BF=D1=80=D0=BE=D1=86?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=D0=BD=D1=8B=D1=85=20=D0=B7=D0=BD=D0=B0=D1=87?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/main/templates/main_index.html | 149 ++++++++++----- static/js/charts/mainIndexCharts.js | 276 ++++++++++++++++++++++++++-- 2 files changed, 363 insertions(+), 62 deletions(-) diff --git a/apps/main/templates/main_index.html b/apps/main/templates/main_index.html index 590604b..73f6258 100644 --- a/apps/main/templates/main_index.html +++ b/apps/main/templates/main_index.html @@ -13,7 +13,10 @@

- Работает под нагрузкой +

@@ -188,30 +191,33 @@
-{#
#} -{#
#} -{#

Y кт-а %

#} -{#
#} -{#
#} -{#
#} -{#

#} -{# 78%

#} -{#
#} -{#
#} -{#

Y кт-а %

#} -{#
#} -{#
#} -{#
#} -{#

#} -{# 55%

#} -{#
#} -{#
#} +
+
+
+ {#
#} + {#
#} + {#

Y кт-а %

#} + {#
#} + {#
#} + {#
#} + {#

#} + {# 78%

#} + {#
#} + {#
#} + {#

Y кт-а %

#} + {#
#} + {#
#} + {#
#} + {#

#} + {# 55%

#} + {#
#} + {#
#} @@ -223,35 +229,78 @@
-{#
#} -{#
#} -{#

Y кт-а %

#} -{#
#} -{#
#} -{#
#} -{#

#} -{# 78%

#} -{#
#} -{#
#} -{#

Y кт-а %

#} -{#
#} -{#
#} -{#
#} -{#

#} -{# 55%

#} -{#
#} -{#
#} +
+
+
+ {#
#} + {#
#} + {#

Y кт-а %

#} + {#
#} + {#
#} + {#
#} + {#

#} + {# 78%

#} + {#
#} + {#
#} + {#

Y кт-а %

#} + {#
#} + {#
#} + {#
#} + {#

#} + {# 55%

#} + {#
#} + {#
#} + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+ {#
#} + {#
#} + {#

Y кт-а %

#} + {#
#} + {#
#} + {#
#} + {#

#} + {# 78%

#} + {#
#} + {#
#} + {#

Y кт-а %

#} + {#
#} + {#
#} + {#
#} + {#

#} + {# 55%

#} + {#
#} + {#
#}
- diff --git a/static/js/charts/mainIndexCharts.js b/static/js/charts/mainIndexCharts.js index 9434b66..4879c42 100644 --- a/static/js/charts/mainIndexCharts.js +++ b/static/js/charts/mainIndexCharts.js @@ -45,7 +45,6 @@ let chart = new ApexCharts(document.querySelector("#m_chart_personal_income_quater_12"), options); chart.render(); })(); - (function () { let options = { chart: { @@ -269,7 +268,6 @@ chart.render(); })(); - (function () { var options = { series: [{ @@ -328,23 +326,277 @@ }; let chart = new ApexCharts(document.querySelector("#monthlyScales"), options); chart.render(); - })(); - (function f() { + + (function () { var options = { - chart: { - type: 'pie' + series: [{ + name: 'Текущая смена', + data: [255, 106, 472, 168, 49] + }, { + name: 'Предыдущая смена', + data: [211, 101, 415, 168, 49] + }, + ], + chart: { + type: 'bar', + height: 350 + }, + plotOptions: { + bar: { + horizontal: false, + columnWidth: '55%', + endingShape: 'rounded' + }, + }, + dataLabels: { + enabled: false + }, + stroke: { + show: true, + width: 2, + colors: ['transparent'] + }, + xaxis: { + categories: ['Поз. 22', 'Поз. 13', 'Поз. 4', 'Поз 22,2', 'Поз 22, 3'], + }, + fill: { + opacity: 1 + }, + tooltip: { + y: { + formatter: function (val) { + return val + " тонн в час" + } + } }, - series: [54, 23], - labels: ['% к-та', '% отсева'], title: { - text: 'Процентные показатели' + text: 'часовая нагрузка' } } - - var chart = new ApexCharts(document.querySelector("#chart"), options); + let chart = new ApexCharts(document.querySelector("#byHourScales"), options); chart.render(); - })() + + })(); + (function () { + const optionsCircle = { + chart: { + type: 'radialBar', + height: '400px' + }, + plotOptions: { + radialBar: { + size: undefined, + inverseOrder: false, + hollow: { + margin: 5, + size: '48%', + background: 'transparent', + }, + track: { + show: true, + background: '#40475D', + strokeWidth: '10%', + opacity: 1, + margin: 3, // margin is in pixels + }, + dataLabels: { + name: { + show: true, + color: '#888', + fontSize: '12px', + fontWeight: 400, + }, + value: { + color: '#111', + offsetY: -2, + fontSize: '12px', + fontWeight: 400, + show: true, + } + } + }, + }, + series: [31, 53], + labels: ['т. смена', 'пр. смена %'], + colors: ['var(--success)', 'var(--primary)', 'var(--danger)'], + legend: { + show: true, + position: 'bottom', + formatter: function (val, opts) { + return val + " - " + opts.w.globals.series[opts.seriesIndex] + '%' + } + }, + title: { + text: 'Y к-та %' + } + } + var chartCircle = new ApexCharts(document.querySelector('#HourCircle_1'), optionsCircle); + chartCircle.render(); + })(); + (function () { + const optionsCircle = { + chart: { + type: 'radialBar', + height: '400px' + + }, + plotOptions: { + radialBar: { + size: undefined, + inverseOrder: false, + hollow: { + margin: 5, + size: '48%', + background: 'transparent', + }, + track: { + show: true, + background: '#40475D', + strokeWidth: '10%', + opacity: 1, + margin: 3, // margin is in pixels + }, + dataLabels: { + name: { + show: true, + color: '#888', + fontSize: '12px', + fontWeight: 400, + }, + value: { + color: '#111', + offsetY: -2, + fontSize: '12px', + fontWeight: 400, + show: true, + } + } + }, + }, + series: [32, 53], + labels: ['т. смена', 'пр. смена %'], + colors: ['var(--success)', 'var(--primary)', 'var(--danger)'], + legend: { + show: true, + position: 'bottom', + formatter: function (val, opts) { + return val + " - " + opts.w.globals.series[opts.seriesIndex] + '%' + } + }, + title: { + text: 'Y отсева %' + } + } + var chartCircle = new ApexCharts(document.querySelector('#HourCircle_2'), optionsCircle); + chartCircle.render(); + })(); + (function () { + const optionsCircle = { + chart: { + type: 'radialBar', + }, + plotOptions: { + radialBar: { + size: undefined, + inverseOrder: false, + hollow: { + margin: 5, + size: '48%', + background: 'transparent', + }, + track: { + show: true, + background: '#40475D', + strokeWidth: '10%', + opacity: 1, + margin: 3, // margin is in pixels + }, + dataLabels: { + name: { + show: true, + color: '#888', + fontSize: '12px', + fontWeight: 400, + }, + value: { + color: '#111', + offsetY: -2, + fontSize: '12px', + fontWeight: 400, + show: true, + } + } + }, + }, + series: [41, 83], + labels: ['Y к-та %', 'Y отсева %'], + colors: ['var(--success)', 'var(--primary)', 'var(--danger)'], + legend: { + show: true, + position: 'left', + formatter: function (val, opts) { + return val + " - " + opts.w.globals.series[opts.seriesIndex] + '%' + } + }, + } + var chartCircle = new ApexCharts(document.querySelector('#dailyCircle'), optionsCircle); + chartCircle.render(); + })(); + (function () { + const optionsCircle = { + chart: { + type: 'radialBar', + }, + plotOptions: { + radialBar: { + size: undefined, + inverseOrder: false, + hollow: { + margin: 5, + size: '48%', + background: 'transparent', + }, + track: { + show: true, + background: '#40475D', + strokeWidth: '10%', + opacity: 1, + margin: 3, // margin is in pixels + }, + dataLabels: { + name: { + show: true, + color: '#888', + fontSize: '12px', + fontWeight: 400, + }, + value: { + color: '#111', + offsetY: -2, + fontSize: '12px', + fontWeight: 400, + show: true, + } + } + }, + }, + series: [71, 63], + labels: ['Y к-та %', 'Y отсева %'], + colors: ['var(--success)', 'var(--primary)', 'var(--danger)'], + legend: { + show: true, + position: 'left', + formatter: function (val, opts) { + return val + " - " + opts.w.globals.series[opts.seriesIndex] + '%' + } + }, + } + var chartCircle = new ApexCharts(document.querySelector('#monthlyCircle'), optionsCircle); + chartCircle.render(); + })(); + + })() //