Snels Nick
Snels Nick

Reputation: 955

How to set x-axis to start at 0 in a Qt5 QChart

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.

Upvotes: 0

Views: 865

Answers (1)

Marcel Petrick
Marcel Petrick

Reputation: 484

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.

Upvotes: 1

Related Questions