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.
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
Re: Scaling Legends when exporting to pdf file
Quote:
Originally Posted by
Uwe
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?
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