mirror of
https://github.com/kalkih/mini-graph-card.git
synced 2025-12-20 00:35:56 +01:00
fix: legend unit percent w/o whitespace (#1191)
if UoM = "%", then do not use a whitespace as a delimeter.
This commit is contained in:
@@ -349,7 +349,11 @@ class MiniGraphCard extends LitElement {
|
||||
const { show_legend_state = false } = this.config.entities[index];
|
||||
|
||||
if (show_legend_state) {
|
||||
legend += ` (${this.computeState(state)} ${this.computeUom(index)})`;
|
||||
if (this.computeUom(index) === '%') {
|
||||
legend += ` (${this.computeState(state)}${this.computeUom(index)})`;
|
||||
} else {
|
||||
legend += ` (${this.computeState(state)} ${this.computeUom(index)})`;
|
||||
}
|
||||
}
|
||||
|
||||
return legend;
|
||||
|
||||
Reference in New Issue
Block a user