|
|
|
|
@ -9,11 +9,10 @@ import matplotlib.pyplot as plt
@@ -9,11 +9,10 @@ import matplotlib.pyplot as plt
|
|
|
|
|
|
|
|
|
|
class EquityChartCanvas(FigureCanvas): |
|
|
|
|
def __init__(self, parent=None, width=5, height=4, dpi=100): |
|
|
|
|
fig = Figure(figsize=(width, height), dpi=dpi) |
|
|
|
|
self.axes = fig.add_subplot(111) |
|
|
|
|
self.fig = Figure(figsize=(width, height), dpi=dpi) |
|
|
|
|
self.pnl_data = None |
|
|
|
|
|
|
|
|
|
FigureCanvas.__init__(self, fig) |
|
|
|
|
FigureCanvas.__init__(self, self.fig) |
|
|
|
|
self.setParent(parent) |
|
|
|
|
|
|
|
|
|
def set_data(self, cumulative_pnl): |
|
|
|
|
@ -21,6 +20,8 @@ class EquityChartCanvas(FigureCanvas):
@@ -21,6 +20,8 @@ class EquityChartCanvas(FigureCanvas):
|
|
|
|
|
self.plot() |
|
|
|
|
|
|
|
|
|
def plot(self): |
|
|
|
|
self.fig.clear() |
|
|
|
|
self.axes = self.fig.add_subplot(111) |
|
|
|
|
if self.pnl_data is not None: |
|
|
|
|
ax = self.figure.add_subplot(111) |
|
|
|
|
ax.plot(self.pnl_data, 'r-') |
|
|
|
|
|