How to add labels on X axis and Y axis of a QChart?
-
This is how the chart ends up looking:

Mind you that I'm calling this method for the labels:
def add_axis_labels(self): # Create a custom label for the X-axis x_axis_label = QGraphicsTextItem("Niveles de pH") x_axis_label.setFont(QFont("Arial", 10)) x_axis_label.setDefaultTextColor(Qt.white) x_axis_label.setPos(self.chart.plotArea().center().x(), self.chart.plotArea().bottom() + 230) x_axis_label.setRotation(-90) self.chart.scene().addItem(x_axis_label) # Create a custom label for the Y-axis y_axis_label = QGraphicsTextItem("Muestras") y_axis_label.setFont(QFont("Arial", 10)) y_axis_label.setDefaultTextColor(Qt.white) y_axis_label.setPos(310, 330) self.chart.scene().addItem(y_axis_label)It's a bit more tedious and I was recommended to use setTitleText() instead but it doesn't seem to work somehow. I'm using PyQt5 so I'm not sure if only works on older versions. Any advice?