code: def generatePicture(self):
      ## pre-computing a QPicture object allows paint() to run much more quickly,
      ## rather than re-drawing the shapes every time.
      self.picture = QtGui.QPicture()
      p = QtGui.QPainter(self.picture)
      p.setPen(pg.mkPen("w"))
      w = (self.data[1][0] - self.data[0][0]) / 3.0
      for t, open, close, min, max in self.data:
          p.drawLine(QtCore.QPointF(t, min), QtCore.QPointF(t, max))
          if open > close:
              p.setBrush(pg.mkBrush("r"))
          else:
              p.setBrush(pg.mkBrush("g"))
          p.drawRect(QtCore.QRectF(t - w, open, w * 2, close - open))
      p.end()
  
file_path: pyqtgraph/pyqtgraph/examples/customGraphicsItem.py
imports: import pyqtgraph
  from pyqtgraph import QtCore, QtGui
label_desc: Use image node_id 2 for calling the CandlestickItem obj's underlying member method code with example usage: obj.generatePicture() without return types