PDA

View Full Version : add item to QCPAxis



bandito
2nd April 2016, 16:07
I am very impressed with QCustomPlot. With what I have so far was much easier then using Java or Python considering this the first time I have ever used C++ and without hardly posting for help. Anyhow, I thought I would ask for help this time. In the picture you can see how I used QCPItemText to display the price and date where ever the cursor position is. I would like the price and date to be displayed on the axises. Bottom of the dates for date and left of prices for price. Any suggestions?

11846

d_stranz
2nd April 2016, 17:18
I am not very familiar with QCP, but it looks like QCPAxisRect is what manages both the set of one or more QCPAxis instances and a QCPLayoutInset. It looks like this latter could contain just about anything, so I would look there to see if you can add your floating label to that.

At worst, you could move your labels so that they are drawn at the intersection of the crosshair instead of at the borders of the plot.

There is a QCustomPlot forum (http://www.qcustomplot.com/index.php/support/forum) which might be a better place to ask your question. In fact, the very last post (yesterday) sounds like it is exactly what you are asking here and could even be you, cross-posting.