class_docstr: Displays a rectangular bar to indicate the relative scale of objects on the view.
class_docstr_tok: ["Displays","a","rectangular","bar","to","indicate","the","relative","scale","of","objects","on","the","view","."]
code: def __init__(
      self, size, width=5, brush=None, pen=None, suffix="m", offset=None
  ):
      GraphicsObject.__init__(self)
      GraphicsWidgetAnchor.__init__(self)
      self.setFlag(self.GraphicsItemFlag.ItemHasNoContents)
      self.setAcceptedMouseButtons(QtCore.Qt.MouseButton.NoButton)
  
      if brush is None:
          brush = getConfigOption("foreground")
      self.brush = fn.mkBrush(brush)
      self.pen = fn.mkPen(pen)
      self._width = width
      self.size = size
      if offset is None:
          offset = (0, 0)
      self.offset = offset
  
      self.bar = QtWidgets.QGraphicsRectItem()
      self.bar.setPen(self.pen)
      self.bar.setBrush(self.brush)
      self.bar.setParentItem(self)
  
      self.text = TextItem(
          text=fn.siFormat(size, suffix=suffix), anchor=(0.5, 1)
      )
      self.text.setParentItem(self)
  
file_path: pyqtgraph/pyqtgraph/graphicsItems/ScaleBar.py
imports: from ..None import functions
  from ..None import getConfigOption
  from ..Point import Point
  from ..Qt import QtCore, QtWidgets
  from .GraphicsObject import GraphicsObject
  from .GraphicsWidgetAnchor import GraphicsWidgetAnchor
  from .TextItem import TextItem
label_desc: Use image node_id 1 to create a new ScaleBar object from inherited base classes: GraphicsWidgetAnchor, GraphicsObject with example: obj = ScaleBar(size, width, brush, pen, suffix, offset)