pyqtgraph - Background color loads only after reloading
<p>I see I'm not <a href="https://stackoverflow.com/questions/31567573/issue-in-setting-the-background-color-in-pyqtgraph">the only one</a> having a problem with background color in pyqtgraph - I'm writing a QGIS software plugin which has an additional dialog box with a graph. I'm trying to set the background color and it loads only after I reload the plugin using QGIS Plugin Reloader plugin (<em>this plugin is made for people developing plugins, so after any change in the code, you refresh and have a new one loaded into QGIS. It is not used by a common user</em>).  </p>

<p>My piece of code below:</p>

<pre><code>import pyqtgraph

...

def prepareGraph(self): # loads on button click

    self.graphTitle = 'Graph one'

    # prepare data - simplified, but data display correctly
    self.y = something
    self.x = something_else

    self.buildGraph() 


def buildGraph(self):
    """ Add data to the graph """
    pyqtgraph.setConfigOption('background', (230,230,230))
    pyqtgraph.setConfigOption('foreground', (100,100,100))
    dataColor = (102,178,255)
    dataBorderColor = (180,220,255)
    barGraph = self.graph.graphicsView
    barGraph.clear()
    barGraph.addItem(pyqtgraph.BarGraphItem(x=range(len(self.x)), height=self.y, width=0.5, brush=dataColor, pen=dataBorderColor))
    barGraph.addItem(pyqtgraph.GridItem())
    barGraph.getAxis('bottom').setTicks([self.x])
    barGraph.setTitle(title=self.graphTitle)

    self.showGraph()


def showGraph(self):
    self.graph.show()
</code></pre>

<p>Interesting thing is that <strong>all parts of <code>buildGraph()</code> load without any issue, (even the foreground color!)</strong> only the background color won't. </p>

<p>Is this a known bug or there is a difference between setting fore- and background color? Linked question didn't help me to solve this problem.</p>

<p><code>pyqtgraph==0.9.10
PyQt4==4.11.4
Python 2.7.3</code></p>