Results 1 to 5 of 5

Thread: Scaling Legends when exporting to pdf file

  1. #1
    Join Date
    Mar 2012
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Scaling Legends when exporting to pdf file

    Is there a way to scale the legend when exporting to a pdf file?

    I’m trying to allow the user to scale the canvas during export but the legends always remain the same size when I do this. I am using Qt 4.8.4 and qwt 6.0.0-rc5. To scale the canvas I call QwtPlotRenderer::render. In an export preview window, the user can move one of two sliders that change the plot rectangle size that gets passed into renderer.

    Ideally I would like to be able to size the legend independently of the canvas. Any hints about how to go about doing this? I like how the plot screen looks and works but just need to deal with more flexibility when exporting & printing. For the QwtPlot, I set the legend ratio when adding the legends to 0.8.

    I’ve played around with calling QwtPlotLayout::setLegendRatio() before calling renderer but this had no effect. I also tried overriding QwtLegend::sizeHint() which did make the font smaller but still laid out the plot with the same amount of space reserved for the legend. This just resulted in more blank space.

    Thanks in advance for any help.

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

    Default Re: Scaling Legends when exporting to pdf file

    First of all I recommend to use Qwt 6.1. It has a completely new system for legends and maybe even more important: it allows to derive and assign a modified QwtPlotLayout, that is responsible for calculating the rectangles used inside the widget and by the QwtPlotRenderer.

    Uwe

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

    Buffy (26th April 2013)

  4. #3
    Join Date
    Apr 2013
    Location
    Российская Федерация
    Posts
    1

    Default it is my opinion

    В Индии взрывы у Тадж Махала, в Америке на марафоне гибнут люди. Жуть какая-то товрится. Что не так с этим миром? На прошлой неделе я писал об этом на своем <a href="http://snowysport.com/">блоге</a>. Заходите, подискутируе м, обсудим, поразмышляем .
    На пути к Универсиаде! Казань 2013!

  5. #4
    Join Date
    Mar 2012
    Posts
    8
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Scaling Legends when exporting to pdf file

    Quote Originally Posted by Uwe View Post
    First of all I recommend to use Qwt 6.1. It has a completely new system for legends and maybe even more important: it allows to derive and assign a modified QwtPlotLayout, that is responsible for calculating the rectangles used inside the widget and by the QwtPlotRenderer.

    Uwe
    Thanks Uwe. I also checked out 6.1 and the legend example that comes along with it but I didn't think 6.1 was released yet. Is it still in Beta or is it released?

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

    Default Re: Scaling Legends when exporting to pdf file

    The code is final ( at least what you find in SVN ) - the only reason that has not been released yet is that I had planned to work on the docs.
    But I don't find any time at the moment ...

    Uwe

Similar Threads

  1. Multiple Legends
    By Pandimensional in forum Qwt
    Replies: 5
    Last Post: 17th August 2012, 08:02
  2. Replies: 3
    Last Post: 7th July 2011, 07:03
  3. How to display external legends in Qwt?
    By saliemam in forum Qwt
    Replies: 3
    Last Post: 8th December 2010, 05:53
  4. How to display external legends in Qwt?
    By saliemam in forum Newbie
    Replies: 0
    Last Post: 1st December 2010, 03:33
  5. Scaling Painter without scaling the coordinate sytem
    By maverick_pol in forum Qt Programming
    Replies: 4
    Last Post: 7th January 2008, 21:30

Tags for this Thread

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.