Re: How to use QwtLegend?
Qwt has it's own examples in subdir of your source code:
.\examples
.\playground
In subdir examples you will find the example "legends".
If you want to have a legend inside your canvas use QwtPlotLegendItem
Re: How to use QwtLegend?
Quote:
Originally Posted by
HappyCoder
Qwt has it's own examples in subdir of your source code:
.\examples
.\playground
In subdir examples you will find the example "legends".
If you want to have a legend inside your canvas use QwtPlotLegendItem
The examples don't do anything I want - they all demonstrate how to plot legends for each curve. I'd like to just create a custom legend from scratch
Re: How to use QwtLegend?
Quote:
Originally Posted by
ashley1
The examples don't do anything I want - they all demonstrate how to plot legends for each curve. I'd like to just create a custom legend from scratch
When your legend is completely unrelated to the plot items you can simply use QLabels and arrange plot and labels in some QLayout.
Otherwise you would need to provide more details: how many bar items do you have and which attributes of them do you want to display how on your legend.
Uwe
Re: How to use QwtLegend?
Quote:
Originally Posted by
ashley1
[...] that red bars are 'negative change' and blue bars are 'positive'
add to ONE red bar the QwtPlotItem::ItemAttribute that it should be shown in legend, all other false
add to ONE blue bar the QwtPlotItem::ItemAttribute that it should be shown in legend, all other false