PDA

View Full Version : Problem with the QwtPlot



cp
28th February 2014, 02:45
Hi,
When I use the QwtPlot,I have a problem with it.If I set the size(width or height) of the plot larger than 32767,and I set the scale div of axis equal with the size(width or height) of plot.There will appear a black area in the bottom of the plot.Why?? Here is some code and picture in forrow.



QwtPlot *plot = new QwtPlot();
plot->enableAxis(QwtPlot::xBottom,false);
QwtScaleDiv div;
QwtLinearScaleEngine *linearEngine=new QwtLinearScaleEngine();
div=linearEngine->divideScale(0,33000,50,0,10);
plot->setAxisScaleDiv(QwtPlot::yLeft,div);
plot->setFixedSize(200,33000);
plot->replot()
;

10087
Thanks for you help!

Uwe
28th February 2014, 06:50
Probably a general limitation somewhere related to a coordinate system in shorts ?
But a size of 33000 for a widget doesn't make sense at all and should ( and could ) be avoided anyway.

Uwe

cp
28th February 2014, 07:27
Thanks for your answer very much.
When I set a size of 33000 for a QWidget,it displays right,there will not appear a black area in the bottom,only in the QwtPlot it appeared.The plot can display with the right width or height,just a black area appear in the bottom.I don't know why.Is it a problem that QT can not support or the qwt can not support?

When I set a size of 32000 for the QwtPlot,and the scale div of the axis is 34000,there will not appear a black area.The plot display right.
Following is the code.

QwtPlot *plot = new QwtPlot();
plot->enableAxis(QwtPlot::xBottom,false);
QwtScaleDiv div;
QwtLinearScaleEngine *linearEngine=new QwtLinearScaleEngine();
div=linearEngine->divideScale(0,34000,50,0,10);
plot->setAxisScaleDiv(QwtPlot::yLeft,div);
plot->setFixedSize(200,32000);
plot->replot();
10088

Uwe
28th February 2014, 09:32
Maybe an issue of the canvas cache ( try to disable it ).

But to be honest: even if you can solve this issue you will run into others later on. Having a widget with a width of more than 30000 is just the wrong way, IMO it is not worth to spend any more second on trying to fix something.

Uwe