Skip to content

Commit dae9ae2

Browse files
committed
Pnl graph is now correctly displayed regarding the current timeframe
1 parent cf7cf57 commit dae9ae2

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

finplotWindow.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,4 +400,14 @@ def drawPnL(self, pln_data):
400400
self.axPnL.show()
401401

402402
pass
403+
404+
def showPnL(self):
405+
self.axPnL.show()
406+
self.axPnL.ax_widget.show()
407+
pass
408+
409+
def hidePnL(self):
410+
self.axPnL.hide()
411+
self.axPnL.ax_widget.hide()
412+
pass
403413

userInterface.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,10 +488,12 @@ def setOrders(self, orders):
488488
# But anyway... it works...
489489
#########
490490
def displayPnL(self, pnl_dataframe):
491-
492491
# draw charts
493492
for timeframe, fpltwindow in self.fpltWindow.items():
494493
fpltwindow.drawPnL(pnl_dataframe)
494+
495+
self.togglePnLWidget()
496+
495497
pass
496498

497499
#########
@@ -628,8 +630,19 @@ def toogleTimeframe(self, timeframe):
628630

629631
self.stackedCharts.setCurrentIndex( self.stackedCharts.indexOf( self.dockAreaTimeframes[timeframe]) )
630632

633+
self.togglePnLWidget()
634+
631635
pass
632636

637+
def togglePnLWidget(self):
638+
639+
# hide all PnL windows & Show the good one
640+
for tf, fpltWindow in self.fpltWindow.items():
641+
if tf != self.current_timeframe:
642+
fpltWindow.hidePnL()
643+
else:
644+
fpltWindow.showPnL()
645+
633646
def resetChart(self):
634647
self.fpltWindow[self.current_timeframe].resetChart()
635648
self.fpltWindow[self.current_timeframe].updateChart()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy