def activate(self):
        StatisticsWidget.activate(self)
        # Late import to speed up app startup.
        from matplotlib import use
        use("Qt5Agg")

        from matplotlib import rcParams
        from matplotlib.figure import Figure
        from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas

        self.setMinimumSize(640, 480)
        self.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                           QtWidgets.QSizePolicy.MinimumExpanding)
        colour = self._background_colour(self.parent)
        fig = Figure(facecolor=colour, edgecolor=colour)
        self.canvas = FigureCanvas(fig)
        self.vbox_layout = QtWidgets.QVBoxLayout(self)
        self.vbox_layout.addWidget(self.canvas)
        self.canvas.setMinimumSize(640, 480)
        self.canvas.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                  QtWidgets.QSizePolicy.MinimumExpanding)
        self.canvas.setParent(self)
        self.axes = fig.add_subplot(111)
        self.canvas.updateGeometry()
        if self.config()["ui_language"].lower().startswith("zh"):
            rcParams['font.sans-serif'] = \
                ["Microsoft YaHei", "WenQuanYi Zen Hei", "Ume P Gothic O5"]
        else:
            rcParams['font.sans-serif'] = ["Arial"]
Exemplo n.º 2
0
 def __init__(self, component_manager, parent, page):
     StatisticsWidget.__init__(self, component_manager)
     self.page = page
     colour = self._background_colour(parent)
     fig = Figure(figsize=(6.5, 5.2), facecolor=colour, edgecolor=colour)
     FigureCanvas.__init__(self, fig)
     FigureCanvas.setSizePolicy(self, QtGui.QSizePolicy.MinimumExpanding, 
                                QtGui.QSizePolicy.MinimumExpanding)
     self.setParent(parent)
     self.axes = fig.add_subplot(111)
     FigureCanvas.updateGeometry(self)
Exemplo n.º 3
0
 def __init__(self, component_manager, parent, page):
     StatisticsWidget.__init__(self, component_manager)
     QtWebKit.QWebView.__init__(self, parent)
     self.page = page
 def __init__(self, component_manager, parent, page):
     QtGui.QWidget.__init__(self, parent)
     StatisticsWidget.__init__(self, component_manager)
     self.parent = parent
     self.page = page
Exemplo n.º 5
0
 def __init__(self, parent, component_manager, page):
     StatisticsWidget.__init__(self, component_manager)
     QtWebKit.QWebView.__init__(self, parent)
     self.page = page
Exemplo n.º 6
0
 def __init__(self, component_manager, parent, page):
     QtGui.QWidget.__init__(self, parent)
     StatisticsWidget.__init__(self, component_manager)
     self.parent = parent
     self.page = page