Results 1 to 2 of 2

Thread: QwtPolar Azimuth labels as text

  1. #1
    Join Date
    May 2018
    Posts
    6

    Default QwtPolar Azimuth labels as text

    Dear all,
    First of all, thank you for this wonderful tool that is qwt. It is really nice to use it and it is plotting nice graphs.
    I have a question regarding qwtpolar, that is probably easy to answer but I cannot figure out how to do.
    I would like to use qwtpolar to make a radar chart but not with north south etc... I would like to put different values of a same object inside (can be 5 or 6 azimuth points for example).
    For this, I need to remove the angle scale on azimuth axis to replace it by text scale (instead of 0, 30, 60 , ... I would like to have for example A1, A2, B1, C1 ....).
    Is there a function to perform this or should I overload QwtRoundScaleDraw::label().
    In the case I need to overload, could you please give me a minimal example? I would be very grateful.
    Thank you very much

  2. #2
    Join Date
    May 2018
    Posts
    6

    Default Re: QwtPolar Azimuth labels as text

    I overloaded QwtRoundScaleDraw and it works.



    Qt Code:
    1. AzimuthLabels::AzimuthLabels(const QList<QString>& azimLabels, const double & intervWidth):
    2. m_azimLabels(azimLabels),
    3. m_intervWidth(intervWidth)
    4. {
    5.  
    6. }
    7.  
    8. QwtText AzimuthLabels::label( double value ) const
    9. {
    10. if(m_azimLabels.size() > 0)
    11. {
    12. if ( value == m_intervWidth * m_azimLabels.size() )
    13. {
    14. return m_azimLabels[0];
    15. }
    16. return m_azimLabels[value / m_intervWidth];
    17. }
    18. else return QString("");
    19. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. QWTPOLAR label text removal from marker after attaching.
    By Uwe Yashwanth in forum General Discussion
    Replies: 1
    Last Post: 27th June 2018, 04:15
  2. Replies: 1
    Last Post: 27th November 2012, 17:52
  3. Overlay text of labels
    By iwatsu in forum Newbie
    Replies: 1
    Last Post: 23rd September 2011, 07:13
  4. Replies: 7
    Last Post: 13th April 2011, 09:42
  5. How to put text labels on a figure
    By tommy in forum Qt Programming
    Replies: 3
    Last Post: 7th May 2009, 17:33

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.