Skip to content

Commit e0a082e

Browse files
committed
only postfix attribute or statistc to trace name if the name was not manually overwritten
1 parent 284869c commit e0a082e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/plotly-graph-card.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,9 +474,10 @@ export class PlotlyGraph extends HTMLElement {
474474
if (!units.includes(unit_of_measurement)) units.push(unit_of_measurement);
475475
const yaxis_idx = units.indexOf(unit_of_measurement);
476476

477-
let name = trace.name || data.meta.friendly_name || entity_id;
477+
let name = data.meta.friendly_name || entity_id;
478478
if (isEntityIdAttrConfig(trace)) name += ` (${trace.attribute}) `;
479479
if (isEntityIdStatisticsConfig(trace)) name += ` (${trace.statistic}) `;
480+
if (trace.name) name = trace.name;
480481
const customdata = data.xs.map((x, i) => ({
481482
unit_of_measurement,
482483
meta,

0 commit comments

Comments
 (0)