Results 1 to 2 of 2

Thread: add item to QCPAxis

  1. #1
    Join Date
    Mar 2016
    Posts
    18
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt5

    Default add item to QCPAxis

    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?

    screen shot.jpg

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: add item to QCPAxis

    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 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.
    Last edited by d_stranz; 2nd April 2016 at 17:36.

Similar Threads

  1. Replies: 0
    Last Post: 25th January 2015, 04:23
  2. Replies: 4
    Last Post: 8th April 2011, 20:59
  3. Replies: 1
    Last Post: 26th August 2009, 15:47
  4. Replies: 5
    Last Post: 10th August 2009, 10:50
  5. Replies: 14
    Last Post: 9th November 2006, 08:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.