Results 1 to 6 of 6

Thread: Qwt: How to create legends inside plots ?

  1. #1
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qwt: How to create legends inside plots ?

    Hi,

    I'm trying to make my first steps with the Qwt library. Really nice library, but how can I create legends inside plots ?
    AFAICS, the only options for QwtLegend are LeftLegend, RightLegend, BottomLegend, TopLegend, and ExternalLegend.
    Do I have to use QLabels or QwtPlotMarkers ?
    The result should look like the 2D-Line-Plot-legends in QtiPlot:
    - a (transparent) box with a black line border
    - one line for each curve inside
    - each line looks like the the lines in QwtLegend (a short color horizontal line followed by the curves' title)
    - the box should be movable with the mouse

    I tried to "get into" QtiPlots' source code, but I'm still a C++ newbie and that's still to much for me...

    Frank

  2. #2
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt: How to create legends inside plots ?

    Damn, I missed the Qwt sub-forum, sorry !
    Could someone move this thread, please ? I don't want to create a duplicate...

  3. #3
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qwt: How to create legends inside plots ?

    Insert your legend as ExternalLegend and move it somewhere on top of your canvas.

    Uwe

  4. #4
    Join Date
    Sep 2008
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt: How to create legends inside plots ?

    I'm very busy these days and can't find some time to continue working on my application...
    I just want to say thank you for your reply, I will try it as soon as possible.

    Frank

  5. #5
    Join Date
    Sep 2007
    Posts
    61
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qwt: How to create legends inside plots ?

    Quote Originally Posted by Uwe View Post
    Insert your legend as ExternalLegend and move it somewhere on top of your canvas.
    How does one "move it" on top of the canvas? For example, if I wanted to modify the bode example to have the legend inside the canvas, how might I do that?

  6. #6
    Join Date
    Aug 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qwt: How to create legends inside plots ?

    it is as normal as adding handling fram so make ExtendedLegend parent as plot and set geometry

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.