Results 1 to 2 of 2

Thread: To draw a custom scale

  1. #1
    Join Date
    Nov 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default To draw a custom scale

    Hello!

    Is it possible to draw a scale values in custom format on QwtPlot?

    I'd like to transform default labels (e.g. 1,2,3...) to special format (e.g. 1eNN, 2eNN, 3eNN...). It shouldn't change the diagram, only labels drawn on the scale.

    Best regards, Indalo.

  2. #2
    Join Date
    Nov 2009
    Posts
    11
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: To draw a custom scale

    Qt Code:
    1. class Ln2eScaleDraw: public QwtScaleDraw
    2. {
    3. public:
    4. Ln2eScaleDraw() {};
    5. virtual ~Ln2eScaleDraw() {};
    6.  
    7. virtual QwtText label(double value) const
    8. {
    9. return QLocale::system().toString(exp(value));
    10. }
    11. };
    To copy to clipboard, switch view to plain text mode 

    I've found the solution.

Similar Threads

  1. Qwt Scale Draw
    By maxpayne in forum Qwt
    Replies: 2
    Last Post: 6th June 2012, 13:01
  2. Replies: 13
    Last Post: 12th June 2008, 13:23
  3. Replies: 2
    Last Post: 16th May 2008, 14:39
  4. Custom proxy model issue
    By Khal Drogo in forum Qt Programming
    Replies: 13
    Last Post: 30th November 2007, 12:41
  5. custom plug-in widget in another custom plug-in widget.
    By MrGarbage in forum Qt Programming
    Replies: 6
    Last Post: 27th August 2007, 15:38

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.