File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -400,4 +400,14 @@ def drawPnL(self, pln_data):
400
400
self .axPnL .show ()
401
401
402
402
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
403
413
Original file line number Diff line number Diff line change @@ -488,10 +488,12 @@ def setOrders(self, orders):
488
488
# But anyway... it works...
489
489
#########
490
490
def displayPnL (self , pnl_dataframe ):
491
-
492
491
# draw charts
493
492
for timeframe , fpltwindow in self .fpltWindow .items ():
494
493
fpltwindow .drawPnL (pnl_dataframe )
494
+
495
+ self .togglePnLWidget ()
496
+
495
497
pass
496
498
497
499
#########
@@ -628,8 +630,19 @@ def toogleTimeframe(self, timeframe):
628
630
629
631
self .stackedCharts .setCurrentIndex ( self .stackedCharts .indexOf ( self .dockAreaTimeframes [timeframe ]) )
630
632
633
+ self .togglePnLWidget ()
634
+
631
635
pass
632
636
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
+
633
646
def resetChart (self ):
634
647
self .fpltWindow [self .current_timeframe ].resetChart ()
635
648
self .fpltWindow [self .current_timeframe ].updateChart ()
You can’t perform that action at this time.
0 commit comments