Changing text color for each tick in QCategoryAxis
-
Is there a way to assign a color for each tick in a QCategoryAxis?
I know I can have a legend, but I prefer setting the colors on the axis to match the colors of the lines I have -
Are you looking for
setLinePen?
https://doc.qt.io/qt-5.10/qtcharts-customchart-example.html -
No. I want to change the color of the markers (text of the categories) themselves, not the ticks (sorry if that was unclear)
-
Did you mean
axis labelcolors? -
I think so...Notice that I want to set a different color for each label
-
If you know the count of the
labelu can usesetLabelsBrush -
Did you mean
axisY.setLabelsBrush(QBrush(Qt::red));But this sets the same color for all the labels.