JKQtPlotter icon indicating copy to clipboard operation
JKQtPlotter copied to clipboard

multiple Y axes

Open goutnet opened this issue 2 years ago • 2 comments

Hi,

does JKQtPlotter support plotting multiple series with different scale/axes (and show multiple Y axes)?

ex: https://doc.qt.io/qt-5/qtcharts-multiaxis-example.html

(from qtCharts)

if not, any pointer on how to go about adding this feature (for a coming pull request)?

goutnet avatar Oct 17 '21 23:10 goutnet

Hi! unfortunately that's not possible at the moment (although I have to plan to implement it, if time permits).

Basically you would have to manage a list of xAxis/yAxis-objects (see http://jkriege2.github.io/JKQtPlotter/class_j_k_q_t_base_plotter.html#abbb07ba367157b245d298139c51a2f2d and http://jkriege2.github.io/JKQtPlotter/class_j_k_q_t_p_coordinate_axis.html). Then each plot element (http://jkriege2.github.io/JKQtPlotter/class_j_k_q_t_p_plot_element.html) needs to be made aware, which one of these axes to use. In its functions like transformX() backtransformX() it then needs to use the transfroms from the selected axis (see http://jkriege2.github.io/JKQtPlotter/class_j_k_q_t_p_plot_element.html#a11781d24405477c6458bd584f5a86462). Finally you would have to adress how to draw several axes ... one on the left border one on the right border would be an option, but one could also think of stacking them on one side ...

I fear that project might get messy, but if you want to give it a shot: go ahead, I would be happy to merge a working code contribution!

Best, JAN

jkriege2 avatar Oct 18 '21 12:10 jkriege2

I see, sounds like it is going to be quite involved indeed, but a valuable contribution nonetheless.

Not sure if I can have time to do it, but thanks for the pointers, I'll let you know how we get there. TBH, it sounds like a multiple pull-request thing :)

goutnet avatar Oct 18 '21 12:10 goutnet

Closing this, as the same topic is discussed (more extensively in issue #87) ... baseline: I'm working on it ...

jkriege2 avatar Mar 22 '23 11:03 jkriege2