Hello,
I'm using this code I found on StackOverflow to fit the axis to the data range :
// the canvas should be perfectly aligned to the boundaries of your curve.
m_pChart->plotLayout()->setAlignCanvasToScales(true);
// the canvas should be perfectly aligned to the boundaries of your curve.
m_pChart->axisScaleEngine(QwtPlot::xBottom)->setAttribute(QwtScaleEngine::Floating, true);
m_pChart->axisScaleEngine(QwtPlot::yLeft)->setAttribute(QwtScaleEngine::Floating, true);
m_pChart->plotLayout()->setAlignCanvasToScales(true);
To copy to clipboard, switch view to plain text mode
After the first replot, if I do some panning or zooming, the second replot will not fit the axis to the data range. In some cases that's fine, but there's case where I want to rescale the axis to the data range.
So do I have to store the min/max somewhere and use QwtPlot::setAxisScale or can this be done automatically (so less code to maintain).
Thanks.
Bookmarks