I have a QChart with an y-axis that goes from -25 to 25. Currently my x-axis is set at the bottom (y = -25 in this case). How can I set the x-axis to start at y=0? Thank you.
Asked
Active
Viewed 615 times
1 Answers
1
As far as I know this is not directly possible, to arrange one axis like this. Documentation says: "Multiple axes can be defined for one chart. The axes can be placed down, up, left, or right of the chart. Further, the axes can be of different types. However, mixing axis types that would result in different domains is not supported, such as specifying QValueAxis and QLogValueAxis on the same orientation."
You can emulate an axis in the center by adding a QLineSeries and then drawing the marks yourself.

Marcel Petrick
- 454
- 3
- 15
-
2Thank you. It is a shame that it isn't supported. I already thought of drawing an x-axis myself, as you suggested, but it felt a bit hackish to me. But I'll go forward with that idea. – Snels Nick Dec 25 '18 at 09:21