Сделал круговые диаграммы процентных значений

This commit is contained in:
zakhy 2024-05-29 12:04:46 +07:00
parent 44b4b347ce
commit 59d971b503
2 changed files with 363 additions and 62 deletions

View File

@ -13,7 +13,10 @@
<div class="m-portlet__head-caption">
<div class="m-portlet__head-title">
<h3 class="m-portlet__head-text">
Работает под нагрузкой
<button type="button"
class="btn m-btn--pill btn-secondary m-btn m-btn--custom m-btn--bolder bg-success border-0">
<span class="roboto text-white">Работает под нагрузкой ( 20ч. )</span>
</button>
</h3>
</div>
</div>
@ -188,30 +191,33 @@
<div class="col-12">
<div class="chart" id="dailyScales"></div>
</div>
{# <div class="col-12">#}
{# <div>#}
{# <h4 style="">Y кт-а %</h4>#}
{# <div class="progress m-progress--sm">#}
{# <div class="progress-bar m--bg-primary"#}
{# role="progressbar"#}
{# style="width: 78%;" aria-valuenow="78"#}
{# aria-valuemin="0" aria-valuemax="100"></div>#}
{# </div>#}
{# <p style="font-size: 18px; font-weight: bold; text-align: center">#}
{# 78%</p>#}
{# </div>#}
{# <div>#}
{# <h4 style="">Y кт-а %</h4>#}
{# <div class="progress m-progress--sm">#}
{# <div class="progress-bar m--bg-primary"#}
{# role="progressbar"#}
{# style="width: 55%;" aria-valuenow="55"#}
{# aria-valuemin="0" aria-valuemax="100"></div>#}
{# </div>#}
{# <p style="font-size: 18px; font-weight: bold; text-align: center">#}
{# 55%</p>#}
{# </div>#}
{# </div>#}
<div class="col-12">
<div class="chart" id="dailyCircle"></div>
</div>
{# <div class="col-12">#}
{# <div>#}
{# <h4 style="">Y кт-а %</h4>#}
{# <div class="progress m-progress--sm">#}
{# <div class="progress-bar m--bg-primary"#}
{# role="progressbar"#}
{# style="width: 78%;" aria-valuenow="78"#}
{# aria-valuemin="0" aria-valuemax="100"></div>#}
{# </div>#}
{# <p style="font-size: 18px; font-weight: bold; text-align: center">#}
{# 78%</p>#}
{# </div>#}
{# <div>#}
{# <h4 style="">Y кт-а %</h4>#}
{# <div class="progress m-progress--sm">#}
{# <div class="progress-bar m--bg-primary"#}
{# role="progressbar"#}
{# style="width: 55%;" aria-valuenow="55"#}
{# aria-valuemin="0" aria-valuemax="100"></div>#}
{# </div>#}
{# <p style="font-size: 18px; font-weight: bold; text-align: center">#}
{# 55%</p>#}
{# </div>#}
{# </div>#}
</div>
</div>
</div>
@ -223,35 +229,78 @@
<div class="col-12">
<div class="chart" id="monthlyScales"></div>
</div>
{# <div class="col-12">#}
{# <div>#}
{# <h4 style="">Y кт-а %</h4>#}
{# <div class="progress m-progress--sm">#}
{# <div class="progress-bar m--bg-primary"#}
{# role="progressbar"#}
{# style="width: 78%;" aria-valuenow="78"#}
{# aria-valuemin="0" aria-valuemax="100"></div>#}
{# </div>#}
{# <p style="font-size: 18px; font-weight: bold; text-align: center">#}
{# 78%</p>#}
{# </div>#}
{# <div>#}
{# <h4 style="">Y кт-а %</h4>#}
{# <div class="progress m-progress--sm">#}
{# <div class="progress-bar m--bg-primary"#}
{# role="progressbar"#}
{# style="width: 55%;" aria-valuenow="55"#}
{# aria-valuemin="0" aria-valuemax="100"></div>#}
{# </div>#}
{# <p style="font-size: 18px; font-weight: bold; text-align: center">#}
{# 55%</p>#}
{# </div>#}
{# </div>#}
<div class="col-12">
<div class="chart" id="monthlyCircle"></div>
</div>
{# <div class="col-12">#}
{# <div>#}
{# <h4 style="">Y кт-а %</h4>#}
{# <div class="progress m-progress--sm">#}
{# <div class="progress-bar m--bg-primary"#}
{# role="progressbar"#}
{# style="width: 78%;" aria-valuenow="78"#}
{# aria-valuemin="0" aria-valuemax="100"></div>#}
{# </div>#}
{# <p style="font-size: 18px; font-weight: bold; text-align: center">#}
{# 78%</p>#}
{# </div>#}
{# <div>#}
{# <h4 style="">Y кт-а %</h4>#}
{# <div class="progress m-progress--sm">#}
{# <div class="progress-bar m--bg-primary"#}
{# role="progressbar"#}
{# style="width: 55%;" aria-valuenow="55"#}
{# aria-valuemin="0" aria-valuemax="100"></div>#}
{# </div>#}
{# <p style="font-size: 18px; font-weight: bold; text-align: center">#}
{# 55%</p>#}
{# </div>#}
{# </div>#}
</div>
</div>
</div>
</div>
<div class="col-xl-4">
<div class="m-portlet m-portlet--full-height m-portlet--fit ">
<div class="m-portlet__body p-2">
<div class="m-widget4 row" style="min-height: 350px">
<div class="col-12">
<div class="chart" id="byHourScales"></div>
</div>
<div class="col-6">
<div class="chart" id="HourCircle_1"></div>
</div>
<div class="col-6">
<div class="chart" id="HourCircle_2"></div>
</div>
{# <div class="col-12">#}
{# <div>#}
{# <h4 style="">Y кт-а %</h4>#}
{# <div class="progress m-progress--sm">#}
{# <div class="progress-bar m--bg-primary"#}
{# role="progressbar"#}
{# style="width: 78%;" aria-valuenow="78"#}
{# aria-valuemin="0" aria-valuemax="100"></div>#}
{# </div>#}
{# <p style="font-size: 18px; font-weight: bold; text-align: center">#}
{# 78%</p>#}
{# </div>#}
{# <div>#}
{# <h4 style="">Y кт-а %</h4>#}
{# <div class="progress m-progress--sm">#}
{# <div class="progress-bar m--bg-primary"#}
{# role="progressbar"#}
{# style="width: 55%;" aria-valuenow="55"#}
{# aria-valuemin="0" aria-valuemax="100"></div>#}
{# </div>#}
{# <p style="font-size: 18px; font-weight: bold; text-align: center">#}
{# 55%</p>#}
{# </div>#}
{# </div>#}
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -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();
})();
})()
// <script>
// {#const height = 'auto'#}