@record-evolution/widget-gauge 1.7.19 → 1.7.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/widget-gauge.ts
CHANGED
|
@@ -45,6 +45,7 @@ export class WidgetGauge extends LitElement {
|
|
|
45
45
|
boxes?: HTMLDivElement[]
|
|
46
46
|
origWidth: number = 600
|
|
47
47
|
origHeight: number = 350
|
|
48
|
+
textContainerHeight: number = 36
|
|
48
49
|
template: EChartsOption
|
|
49
50
|
modifier: number = 1
|
|
50
51
|
version: string = 'versionplaceholder'
|
|
@@ -254,7 +255,10 @@ export class WidgetGauge extends LitElement {
|
|
|
254
255
|
this.gaugeContainer.style.gridTemplateColumns = `repeat(${fit.c}, 1fr)`
|
|
255
256
|
|
|
256
257
|
this.boxes?.forEach((box) =>
|
|
257
|
-
box.setAttribute(
|
|
258
|
+
box.setAttribute(
|
|
259
|
+
'style',
|
|
260
|
+
`width:${modifier * chartW}px; height:${modifier * (chartH - this.textContainerHeight)}px`
|
|
261
|
+
)
|
|
258
262
|
)
|
|
259
263
|
|
|
260
264
|
this.modifier = modifier
|
|
@@ -347,13 +351,14 @@ export class WidgetGauge extends LitElement {
|
|
|
347
351
|
ga.data[0].value = ds.needleValue
|
|
348
352
|
ga.data[0].name = ds.unit
|
|
349
353
|
// unit style
|
|
350
|
-
|
|
354
|
+
|
|
355
|
+
ga.title.fontSize = 32 * modifier
|
|
351
356
|
ga.title.color = ds.valueColor || this.themeTitleColor
|
|
352
357
|
ga.title.opacity = 1
|
|
353
358
|
// value style
|
|
354
359
|
ga.detail.color = ds.valueColor || this.themeTitleColor
|
|
355
360
|
ga.detail.opacity = 1
|
|
356
|
-
ga.detail.fontSize =
|
|
361
|
+
ga.detail.fontSize = 60 * modifier
|
|
357
362
|
|
|
358
363
|
ga.detail.formatter = (val: number) =>
|
|
359
364
|
isNaN(val) ? '-' : val.toFixed(Math.floor(ds.precision ?? 0))
|
|
@@ -388,7 +393,7 @@ export class WidgetGauge extends LitElement {
|
|
|
388
393
|
ga2.axisLine.lineStyle.color = colorSections?.length
|
|
389
394
|
? colorSections
|
|
390
395
|
: ga2.axisLine.lineStyle.color
|
|
391
|
-
ga2.axisLabel.fontSize =
|
|
396
|
+
ga2.axisLabel.fontSize = 24 * modifier
|
|
392
397
|
// ga2.axisLabel.color = ds.valueColor
|
|
393
398
|
ga2.axisLabel.distance = -24 * modifier
|
|
394
399
|
ga2.splitLine.length = 16 * modifier
|
|
@@ -407,9 +412,9 @@ export class WidgetGauge extends LitElement {
|
|
|
407
412
|
|
|
408
413
|
const titleElement = this.canvasList.get(ds.label)?.title
|
|
409
414
|
if (titleElement) {
|
|
410
|
-
titleElement.style.fontSize = String(
|
|
415
|
+
titleElement.style.fontSize = String(36 * modifier) + 'px'
|
|
411
416
|
titleElement.style.maxWidth = String(300 * modifier) + 'px'
|
|
412
|
-
titleElement.style.height = String(
|
|
417
|
+
titleElement.style.height = String(this.textContainerHeight * modifier) + 'px'
|
|
413
418
|
titleElement.textContent = ds.label ?? ''
|
|
414
419
|
}
|
|
415
420
|
|
|
@@ -509,6 +514,11 @@ export class WidgetGauge extends LitElement {
|
|
|
509
514
|
overflow: hidden;
|
|
510
515
|
text-overflow: ellipsis;
|
|
511
516
|
white-space: nowrap;
|
|
517
|
+
line-height: 0.8;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.title {
|
|
521
|
+
line-height: 1.5;
|
|
512
522
|
}
|
|
513
523
|
p {
|
|
514
524
|
margin: 10px 0 0 0;
|
|
@@ -538,7 +548,7 @@ export class WidgetGauge extends LitElement {
|
|
|
538
548
|
style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}"
|
|
539
549
|
>
|
|
540
550
|
<header class="paging" ?active=${this.inputData?.title || this.inputData?.subTitle}>
|
|
541
|
-
<h3 class="paging" ?active=${this.inputData?.title}>${this.inputData?.title}</h3>
|
|
551
|
+
<h3 class="paging title" ?active=${this.inputData?.title}>${this.inputData?.title}</h3>
|
|
542
552
|
<p
|
|
543
553
|
class="paging"
|
|
544
554
|
?active=${this.inputData?.subTitle}
|