summaryrefslogtreecommitdiff
path: root/silx/gui/plot/StatsWidget.py
diff options
context:
space:
mode:
Diffstat (limited to 'silx/gui/plot/StatsWidget.py')
-rw-r--r--silx/gui/plot/StatsWidget.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/silx/gui/plot/StatsWidget.py b/silx/gui/plot/StatsWidget.py
index 52b7e5c..6b92ea0 100644
--- a/silx/gui/plot/StatsWidget.py
+++ b/silx/gui/plot/StatsWidget.py
@@ -1,7 +1,7 @@
# coding: utf-8
# /*##########################################################################
#
-# Copyright (c) 2017-2019 European Synchrotron Radiation Facility
+# Copyright (c) 2017-2020 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
@@ -180,7 +180,10 @@ class _PlotWidgetWrapper(_Wrapper):
def getItems(self):
plot = self.getPlot()
- return () if plot is None else plot._getItems()
+ if plot is None:
+ return ()
+ else:
+ return [item for item in plot.getItems() if item.isVisible()]
def getSelectedItems(self):
plot = self.getPlot()
@@ -198,10 +201,10 @@ class _PlotWidgetWrapper(_Wrapper):
kind = self.getKind(item)
if kind in plot._ACTIVE_ITEM_KINDS:
if plot._getActiveItem(kind) != item:
- plot._setActiveItem(kind, item.getLegend())
+ plot._setActiveItem(kind, item.getName())
def getLabel(self, item):
- return item.getLegend()
+ return item.getName()
def getKind(self, item):
if isinstance(item, plotitems.Curve):
@@ -1371,7 +1374,7 @@ class _BaseLineStatsWidget(_StatsWidgetBase, qt.QWidget):
return self._plotWrapper.getKind(_item) == self.getKind()
items = list(filter(kind_filter, _items))
assert len(items) in (0, 1)
- if len(items) is 1:
+ if len(items) == 1:
self._setItem(items[0])
def setKind(self, kind):
@@ -1413,7 +1416,7 @@ class _BaseLineStatsWidget(_StatsWidgetBase, qt.QWidget):
return self._plotWrapper.getKind(_item) == self.getKind()
items = list(filter(kind_filter, _items))
assert len(items) in (0, 1)
- _item = items[0] if len(items) is 1 else None
+ _item = items[0] if len(items) == 1 else None
self._setItem(_item)
def _updateCurrentItem(self):