def set_value(self, value): """Accepts a camelot.container.chartcontainer.FigureContainer or a camelot.container.chartcontainer.AxesContainer """ from camelot.container.chartcontainer import structure_to_figure_container self._value = structure_to_figure_container( AbstractCustomEditor.set_value(self, value)) self.on_draw()
def set_value(self, value): """Accepts a camelot.container.chartcontainer.FigureContainer or a camelot.container.chartcontainer.AxesContainer """ from camelot.container.chartcontainer import structure_to_figure_container self._value = structure_to_figure_container( super(ChartEditor, self).set_value(value)) self.on_draw()
def show_fullscreen_chart(chart, parent): """ :param chart: a chart container :return: the widget showing the chart, by default a LiteBoxView """ from matplotlib.figure import Figure from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from camelot.view.controls.liteboxview import LiteBoxView from camelot.container.chartcontainer import structure_to_figure_container figure_container = structure_to_figure_container(chart) litebox = LiteBoxView(parent) fig = Figure(facecolor='#ffffff') canvas = FigureCanvas(fig) canvas.updateGeometry() figure_container.plot_on_figure(fig) proxy = QtGui.QGraphicsProxyWidget() proxy.setWidget(canvas) litebox.show_fullscreen_item(proxy) canvas.draw() return litebox
def show_fullscreen_chart(chart, parent): """ :param chart: a chart container :return: the widget showing the chart, by default a LiteBoxView """ from matplotlib.figure import Figure from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from camelot.view.controls.liteboxview import LiteBoxView from camelot.container.chartcontainer import structure_to_figure_container figure_container = structure_to_figure_container( chart ) litebox = LiteBoxView(parent) fig = Figure(facecolor='#ffffff') canvas = FigureCanvas(fig) canvas.updateGeometry() figure_container.plot_on_figure(fig) proxy = QtGui.QGraphicsProxyWidget() proxy.setWidget(canvas) litebox.show_fullscreen_item(proxy) canvas.draw() return litebox
def __init__(self, chart): from camelot.container.chartcontainer import structure_to_figure_container super(ChartDocument, self).__init__() self.chart = structure_to_figure_container(chart)
def set_value(self, value): """Accepts a camelot.container.chartcontainer.FigureContainer or a camelot.container.chartcontainer.AxesContainer """ from camelot.container.chartcontainer import structure_to_figure_container self._value = structure_to_figure_container( super(ChartEditor, self).set_value(value) ) self.on_draw()
def set_value(self, value): """Accepts a camelot.container.chartcontainer.FigureContainer or a camelot.container.chartcontainer.AxesContainer """ from camelot.container.chartcontainer import structure_to_figure_container self._value = structure_to_figure_container( AbstractCustomEditor.set_value( self, value ) ) self.on_draw()
def __init__( self, chart ): from camelot.container.chartcontainer import structure_to_figure_container super( ChartDocument, self ).__init__() self.chart = structure_to_figure_container( chart )