0

I have to place 4 spines on the same chart with different Y ratios, so I need to set up 4 Y-axes.
I have read the "muti-axis" demo from QT creator, it shows a example of two Y-axis and the two Y-axis are put on left and right side.

2 Y axis Demo From QT Creator

It's good when there is only two spines, but when I have 4 spines, how to relocate the 4 Y axis? Is it possible to place the 4 Y-axis at the tick point of X-axis? like the image below.

4 Axis like this

JaMiT
  • 14,422
  • 4
  • 15
  • 31
Ye Shiwei
  • 9
  • 5

1 Answers1

0

I used ChartJs2QML for displaying charts in QML.
Below is the approach I followed for multiple y axes. Maybe a similar approach can be adopted in Qt as well.

  • Show labels of all the y axes in the legend.
  • Show only one y axis by default. Hide all the other y axes.
  • On click of any y axes label in legend, hide the active y axis and show the clicked y axis.
Arun Kumar B
  • 196
  • 9
  • Thank u, I have already implement this on QT, just similar to when you've mentioned, hide the other axes and show only one axis. – Ye Shiwei Dec 15 '21 at 06:42