Skip to content

Commit

Permalink
Use initial datalabel for non-overlaid volume plot
Browse files Browse the repository at this point in the history
  • Loading branch information
backtrader committed May 30, 2019
1 parent 6fc4f4a commit e975b16
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions backtrader/plot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,14 @@ def plotdata(self, data, indicators):
if pmaster is data:
pmaster = None

datalabel = ''
if hasattr(data, '_name') and data._name:
datalabel += data._name

voloverlay = (self.pinf.sch.voloverlay and pmaster is None)

if not voloverlay:
vollabel += ' ({})'.format(data._dataname)
vollabel += ' ({})'.format(datalabel)

# if self.pinf.sch.volume and self.pinf.sch.voloverlay:
axdatamaster = None
Expand All @@ -678,11 +682,6 @@ def plotdata(self, data, indicators):
ax = axdatamaster.twinx()
self.pinf.vaxis.append(ax)

datalabel = ''
dataname = ''
if hasattr(data, '_name') and data._name:
datalabel += data._name

if hasattr(data, '_compression') and \
hasattr(data, '_timeframe'):
tfname = TimeFrame.getname(data._timeframe, data._compression)
Expand Down

0 comments on commit e975b16

Please sign in to comment.