This commit is contained in:
vn.py 2019-09-04 22:41:33 +08:00
parent dc97cbde06
commit 019da35a55

View File

@ -106,6 +106,10 @@ class ChartWidget(pg.PlotWidget):
# Store plot object in dict # Store plot object in dict
self._plots[plot_name] = plot self._plots[plot_name] = plot
# Add plot onto the layout
self._layout.nextRow()
self._layout.addItem(plot)
def add_item( def add_item(
self, self,
item_class: Type[ChartItem], item_class: Type[ChartItem],
@ -120,10 +124,8 @@ class ChartWidget(pg.PlotWidget):
plot = self._plots.get(plot_name) plot = self._plots.get(plot_name)
plot.addItem(item) plot.addItem(item)
self._item_plot_map[item] = plot
self._layout.nextRow() self._item_plot_map[item] = plot
self._layout.addItem(plot)
def get_plot(self, plot_name: str) -> pg.PlotItem: def get_plot(self, plot_name: str) -> pg.PlotItem:
""" """