mirror of
https://github.com/IoTManagerProject/IoTManagerWeb.git
synced 2026-03-27 15:32:29 +03:00
графики расхода
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
function blink() {
|
||||
if (widget.status) {
|
||||
if (widget.status != prevStatus) {
|
||||
setTimeout(stopBlink, 4000);
|
||||
setTimeout(stopBlink, 500);
|
||||
green = true;
|
||||
}
|
||||
prevStatus = widget.status;
|
||||
@@ -31,8 +31,8 @@
|
||||
</div>
|
||||
<div class="flex justify-end w-1/3">
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="wgt-adt-stl {green ? 'text-green-500 animate-pulse' : ''}">{!widget.status ? "" : widget.status}</label>
|
||||
<label class="wgt-adt-stl {green ? 'text-green-500' : ''}">{!widget.status ? "" : widget.status}</label>
|
||||
<!-- svelte-ignore a11y-label-has-associated-control -->
|
||||
<label class="wgt-adt-stl {green ? 'text-green-500 animate-pulse' : ''}"> {!widget.after ? "" : widget.after}</label>
|
||||
<label class="wgt-adt-stl {green ? 'text-green-500' : ''}"> {!widget.after ? "" : widget.after}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
lineOptions = { regionFill: 1, dotSize: 3, spline: 1 };
|
||||
}
|
||||
|
||||
let type = "line";
|
||||
if (widget.type == "bar") {
|
||||
type = widget.type;
|
||||
}
|
||||
|
||||
$: widget, collectDataToArr();
|
||||
|
||||
function collectDataToArr() {
|
||||
@@ -49,7 +54,9 @@
|
||||
}
|
||||
|
||||
for (let i = 0; i < widget.status.length; i++) {
|
||||
if (i === 0) {
|
||||
if (type === "bar") {
|
||||
labels[i] = getDDMM(widget.status[i].x);
|
||||
} else if (i === 0) {
|
||||
labels[i] = getDDMM(widget.status[i].x);
|
||||
} else {
|
||||
labels[i] = getHHMM(widget.status[i].x);
|
||||
@@ -107,4 +114,4 @@
|
||||
<label class="inline-block italic align-top text-center text-gray-500 txt-sz">{!widget.descr ? "" : widget.descr}</label>
|
||||
</div>
|
||||
|
||||
<Chart data={datachart} type="line" lineOptions={lineOptions} axisOptions={axisOptions} height="200" padding="0px" />
|
||||
<Chart data={datachart} type={type} lineOptions={lineOptions} axisOptions={axisOptions} height="200" padding="0px" />
|
||||
|
||||
Reference in New Issue
Block a user