From dea0663444dba3606790e061a7cd1b2368c5523a Mon Sep 17 00:00:00 2001 From: Zeel Patel Date: Mon, 14 Jun 2021 23:58:50 -0700 Subject: [PATCH] Fix legends values on histogram kernc#195 --- backtesting/_plotting.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/backtesting/_plotting.py b/backtesting/_plotting.py index 7ccdafc9..0f8ae18e 100644 --- a/backtesting/_plotting.py +++ b/backtesting/_plotting.py @@ -534,9 +534,7 @@ def __eq__(self, other): if is_overlay: ohlc_extreme_values[source_name] = arr if is_histogram: - fig.vbar(x=source.data['index'], legend_label=legend_label, - bottom=[0 for _ in source.data['index']], - top=arr, width=BAR_WIDTH, color=color) + fig.vbar('index', BAR_WIDTH, source_name, source=source, legend_label=legend_label, color=color) elif is_scatter: fig.scatter( 'index', source_name, source=source, @@ -550,9 +548,7 @@ def __eq__(self, other): line_width=1.3) else: if is_histogram: - r = fig.vbar(x=source.data['index'], legend_label=LegendStr(legend_label), - bottom=[0 for _ in source.data['index']], - top=arr, width=BAR_WIDTH, color=color) + r = fig.vbar('index', BAR_WIDTH, source_name, source=source, legend_label=LegendStr(legend_label), color=color) elif is_scatter: r = fig.scatter( 'index', source_name, source=source,