Important: Please read the Qt Code of Conduct -

ChartView/ValueAxis - How to NOT label the maximum value tick on the ValueAxis

  • I am developing on Windows for an embedded device that runs Linux. Our chart goes from -200 to 1000. On Windows, the maximum value (1000) has a gridline but no label. On the target platform, the maximum value has both a gridline and a label.

    It looks better without the label. Is there any way to turn off that label so we can get a consistent, and desired, display on both platforms? Is there a way to access the maximum label from the ValueAxis instance and set visible to, "false", for that individual label? Clumsy, yes, but...

  • I don't see any way to adjust this. I also don't see any examples of using AbstractAxis to create a custom axis type to display how you want. I looked at the code for ValueAxis and it is c++. I was hoping it was qml and based on AbstractAxis. Alas, it is not.

  • If I set the maximum value for the axis to just slightly less than that of the next tick, for example 999 when the next tick should be at 1000, it will not show the top label. Sadly though, it also will not show the top grid line, which helps to frame the graph.

  • You could draw a line on top. Not ideal.

    Width of 1 rect with border.

Log in to reply