PDA

View Full Version : Qwt: How to create legends inside plots ?



Comer352l
21st November 2008, 13:51
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

Comer352l
22nd November 2008, 11:48
Damn, I missed the Qwt sub-forum, sorry !
Could someone move this thread, please ? I don't want to create a duplicate...

Uwe
24th November 2008, 09:17
Insert your legend as ExternalLegend and move it somewhere on top of your canvas.

Uwe

Comer352l
10th December 2008, 14:07
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

bigjoeystud
20th July 2009, 04:02
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?

kupendrabp
16th August 2009, 19:02
it is as normal as adding handling fram so make ExtendedLegend parent as plot and set geometry