2 Attachment(s)
Problems with vanishing ticks
Hello,
the following images describe the problem better than I could with words. In the first image, there is some data displayed. The last data point has an x value of 20.
Attachment 13267
The second image shows the same data, just shifted one pixel to the right.
Attachment 13268
As you can see, the tick with the "20" disappeared completly and leaves a blank space, although there is more than enough space apparently.
I am aware of the method QwtScaleEngine::setAttribute and we set the "Floating" attribute to true. Still the tick at the end disappears. I also checked the methods QwtScaleWidget::setMinBorderDist and QwtScaleWidget::setBorderDist and set all values to 0 (I tried even negative numbers), but it did not help at all.
We are using Qt 5.12 and Qwt 6.1.3.
Has anyone a solution for the problem?
Re: Problems with vanishing ticks
QwtPlot does not offer scales, where the ticks go inwards - so this is probably custom code.
Uwe
Re: Problems with vanishing ticks
Quote:
Originally Posted by
Uwe
QwtPlot does not offer scales, where the ticks go inwards - so this is probably custom code.
Uwe
While it is true, that we customized some parts of the QwtPlot, the inside ticks are created with means from the qwt library only. We simply created a QwtPlotScaleItem with the opposite alignment for each axis (e.g. QwtScaleDraw::RightScale for QwtPlot::yLeft). Other features (like QwtScaleEngine) were not customized. So the positioning and visibility of the ticks are still calculated by the qwt engine.
Re: Problems with vanishing ticks
Quote:
Originally Posted by
mwh
We simply created a QwtPlotScaleItem with the opposite alignment for each axis (e.g. QwtScaleDraw::RightScale for QwtPlot::yLeft).
And how is your scale item connected to which scale engine ?
Uwe
Re: Problems with vanishing ticks
Quote:
Originally Posted by
Uwe
And how is your scale item connected to which scale engine ?
Uwe
Like this:
Code:
// This code is taken from your example code in the documention of QwtPlotScaleItem
scaleItem
->setFont
(plot
->axisWidget
(QwtPlot::xBottom)->font
());
// This is the customized part
scaleItem
->setXAxis
(QwtPlot::xBottom);
scaleItem->setScaleDivFromAxis(true);
// This is from your documentation again
scaleItem->attach(plot);
According to your documentation the setSCaleDivFromAxis method synchronizes the scale item with the corresponding axis. Am I missing anything?
Re: Problems with vanishing ticks
O.k. so you are using a scale item, that is fed by the scale engine of the bottom scale, but you gave no information about how this one is set up.
Maybe it makes more sense, that you upload a small compilable tarball demonstrating the problem.
Uwe