diff --git a/src/AllPlot.cpp b/src/AllPlot.cpp index ae89ef5c2..87c8760cf 100644 --- a/src/AllPlot.cpp +++ b/src/AllPlot.cpp @@ -847,7 +847,7 @@ AllPlot::setYMax() int axisHeight = qRound( plotLayout()->canvasRect().height() ); QFontMetrics labelWidthMetric = QFontMetrics( QwtPlot::axisFont(yLeft) ); - int labelWidth = labelWidthMetric.width( (maxY > 1000) ? "8888 " : "888 " ); + int labelWidth = labelWidthMetric.width( (maxY > 1000) ? " 8,888 " : " 888 " ); int step = 100; while( ( qCeil(maxY / step) * labelWidth ) > axisHeight ) @@ -896,8 +896,24 @@ AllPlot::setYMax() balanceLCurve->setBaseline(50); balanceRCurve->setBaseline(50); } + + int axisHeight = qRound( plotLayout()->canvasRect().height() ); + QFontMetrics labelWidthMetric = QFontMetrics( QwtPlot::axisFont(yLeft) ); + int labelWidth = labelWidthMetric.width( "888 " ); + + ymax *= 1.05; + int step = 10; + while( ( qCeil(ymax / step) * labelWidth ) > axisHeight ) + { + nextStep(step); + } + + QwtValueList xytick[QwtScaleDiv::NTickTypes]; + for (int i=0;isetDataFromPlot(fullPlot, startIndex, stopIndex); _allPlot->setAxisScale(QwtPlot::xBottom, _stackWidth*i, _stackWidth*(i+1), 15/stackWidth); - if (i==0){ - // First plot view title and legend - //_allPlot->setTitle(allPlot->title()); - //_allPlot->plotLayout()->setLegendPosition(QwtPlot::TopLegend); - _allPlot->setFixedHeight(120+stackWidth*2+50); - } - else { - _allPlot->setTitle(""); - //_allPlot->insertLegend(NULL); - _allPlot->setFixedHeight(120+stackWidth*2); - } + _allPlot->setFixedHeight(120+stackWidth*2); // No x axis titles _allPlot->setAxisTitle(QwtPlot::xBottom,NULL);