Results 1 to 3 of 3

Thread: align QwtLegendItems to their curves

  1. #1
    Join Date
    Nov 2011
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default align QwtLegendItems to their curves

    Hey hey,

    allright...i have a QwtPlot and a QwtLegend and QwtPlotCurves attached to it. The titles of the curves can be seen in the QwtLegend (attached screenshot - how it is)
    Now my question is: is it possible to order the legend items in a way, that every curve has its name straight beside itself? (attached screenshot - how it should be)

    Thx so far!
    cradle
    Attached Images Attached Images
    Last edited by cradle; 9th November 2011 at 13:02.

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

    Default Re: align QwtLegendItems to their curves

    As all curves have the same line/symbol settings I wouldn't use a legend and do it with tick labels instead.

    1. assign a QwtScaleDiv ( QwtPlot::setAxisScaleDiv() ) with major ticks at the y values that correspond to your curves.
    2. Derive from QwtScaleDraw, disable everything beside the tick labels and reimplement YourScaleDraw::label()

    HTH,
    Uwe

  3. The following user says thank you to Uwe for this useful post:

    cradle (9th November 2011)

  4. #3
    Join Date
    Nov 2011
    Posts
    8
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: align QwtLegendItems to their curves

    Hey Uwe,

    Thanks for the tip. That does the trick!

Similar Threads

  1. QTabWidget align
    By AlexD in forum Qt Programming
    Replies: 6
    Last Post: 10th August 2012, 14:19
  2. multi plots
    By 21did21 in forum Qwt
    Replies: 7
    Last Post: 24th May 2011, 02:11
  3. qwt plots & inheritance
    By fatecasino in forum Qwt
    Replies: 1
    Last Post: 14th December 2010, 15:35
  4. Plots and Layouts
    By Ozzy in forum Qwt
    Replies: 5
    Last Post: 17th November 2009, 10:00
  5. Reg multiple plots in Qwt
    By Tavit in forum Qwt
    Replies: 4
    Last Post: 23rd June 2008, 14:43

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.