PDA

View Full Version : Histogram plot



gib
23rd May 2018, 00:51
I am exploring migrating from Qwt 5 to Qwt 6. I have code to plot histograms, based on the histogram example in Qwt 5. I see that this example is not included in the Qwt 6 distribution, and the old example cannot be built with Qwt 6. I am looking for histogram code that works with Qwt 6 - can anyone help?

Thanks
Gib

Now I see that QwtPlotHistogram has been provided. I'll check this out.

gib
23rd May 2018, 05:58
Problem with Qwt 6. I built the library successfully, but I get quite a few link errors when I start trying to build my program. This is a very stripped down version at the moment. I have commented the code that does the actual plotting, but left the skeleton of my Plot class:
class Plot : public QwtPlot
The errors I get don't make sense to me, because they all refer to functions that I'm not using, e.g.:

plot.obj:-1: error: LNK2001: unresolved external symbol "protected: virtual void __thiscall QwtPlot::legendItemClicked(void)" (?legendItemClicked@QwtPlot@@MAEXXZ)
plot.obj:-1: error: LNK2001: unresolved external symbol "protected: virtual void __thiscall QwtPlot::updateTabOrder(void)" (?updateTabOrder@QwtPlot@@MAEXXZ)

This obviously results from a change made from Qwt 5 to Qwt 6, presumably in QwtPlot. What am I doing wrong?

gib
23rd May 2018, 08:07
I changed from Qwt 6.0.1 to 6.1.3, and maybe fixed some other problems without realising it, and now I don't get those link errors, and I can now create and save-to-image-file line plots. Soon I hope to have the histogram plots working too.
...
All working!
QwtPlotRenderer is great, much better than the old method.