PDA

View Full Version : Histogram



giusepped
9th March 2010, 08:18
Hi.
I tried to put a legend in Hisotrgr. Although the legend is displayed, there are no symbols attached to the text in the legend.
Why?



legend = new QwtLegend;



rataPlot = new HistogramItem(tr("Rata"));
rataPlot->attach(qwtPlot);
rataPlot->setColor(Qt::red);

rawPlot = new HistogramItem(tr("MOL - Dati grezzi"));
rawPlot->attach(qwtPlot);
rawPlot->setColor(Qt::darkGray);

qwtPlot->setCanvasBackground(QColor(Qt::white));

qwtPlot->insertLegend(legend,QwtPlot::BottomLegend);

Uwe
9th March 2010, 08:54
Because the implementation of HistogramItem ( if it is the one from the Qwt examples ) is incomplete. If you want to see more than the text only you have to implement HistogramItem::updateLegend().

Uwe