Skip to content

Commit d673d0a

Browse files
committed
BUG: Single legend item for indicators with singular/default names
Refs: 01551af Populating legends with numerous `λ[i]` items was never the intention of #382
1 parent 3938cf7 commit d673d0a

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

backtesting/_plotting.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -567,13 +567,7 @@ def __eq__(self, other):
567567

568568
if isinstance(value.name, str):
569569
tooltip_label = value.name
570-
if len(value) == 1:
571-
legend_labels = [LegendStr(value.name)]
572-
else:
573-
legend_labels = [
574-
LegendStr(f"{value.name}[{i}]")
575-
for i in range(len(value))
576-
]
570+
legend_labels = [LegendStr(value.name)] * len(value)
577571
else:
578572
tooltip_label = ", ".join(value.name)
579573
legend_labels = [LegendStr(item) for item in value.name]

0 commit comments

Comments
 (0)