Skip to content

Commit

Permalink
Fix legends values on histogram kernc#195
Browse files Browse the repository at this point in the history
  • Loading branch information
zlpatel committed Jun 15, 2021
1 parent bf2585c commit dea0663
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions backtesting/_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit dea0663

Please sign in to comment.