What is the way I can plot a bar chart in a graphics view created with Qt Designer?
Following an example I found, I tried the following without success. The variable gv_spec is a graphics view item promoted to a PlotWidget in Designer.
curve2 = self.gv_spec.plot()
y1 = np.linspace(0, np.floor(x_time[-1]/fs), data2.shape[0])
bg1 = pg.BarGraphItem(x=data2, height=y1, width=0.6, brush='r')
curve2.addItem(bg1)
This yields the error: AttributeError: 'PlotDataItem' object has no attribute 'addItem'
My goal is simply to change from a line graph to a bar chart. This line that I was using works fine in displaying the line graph.
curve2 = self.gv_spec.plot(data2, clickable=True,
fillBrush=pg.mkBrush(0, 255, 0, 100), fillLevel=0)
How can I convert this line graph to a bar chart?