Ejemplo n.º 1
0
	int PlotItem::CalcXExtent (QwtPlot& plot) const
	{
		int result = 0;
		if (LeftAxisEnabled_)
			result += plot.axisScaleDraw (QwtPlot::yLeft)->
					extent (plot.axisFont (QwtPlot::yLeft));
		return result;
	}
Ejemplo n.º 2
0
void PlotMatrix::updateLayout()
{
    for ( int row = 0; row < numRows(); row++ )
    {
        for ( int col = 0; col < numColumns(); col++ )
        {
            QwtPlot *p = plot( row, col );
            if ( p )
            {
                bool showAxis[QwtPlot::axisCnt];
                showAxis[QwtPlot::xBottom] =
                    axisEnabled( QwtPlot::xBottom ) && row == numRows() - 1;
                showAxis[QwtPlot::xTop] =
                    axisEnabled( QwtPlot::xTop ) && row == 0;
                showAxis[QwtPlot::yLeft] =
                    axisEnabled( QwtPlot::yLeft ) && col == 0;
                showAxis[QwtPlot::yRight] =
                    axisEnabled( QwtPlot::yRight ) && col == numColumns() - 1;

                for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
                {
                    if ( axis == QwtPlot::xBottom || axis == QwtPlot::xTop )
                        p->enableAxis( axis, showAxis[axis] );
                    else
                    {
                        p->enableAxis( axis, true );

                        QwtScaleDraw *sd = p->axisScaleDraw( axis );
                        sd->enableComponent(
                            QwtScaleDraw::Backbone, showAxis[axis] );
                        sd->enableComponent(
                            QwtScaleDraw::Ticks, showAxis[axis] );
                        sd->enableComponent(
                            QwtScaleDraw::Labels, showAxis[axis] );
                    }
                }
            }
        }
    }

    for ( int col = 0; col < numColumns(); col++ )
    {
        alignVAxes( col, QwtPlot::yLeft );
        alignVAxes( col, QwtPlot::yRight );
    }

    for ( int row = 0; row < numRows(); row++ )
    {
        for ( int col = 0; col < numColumns(); col++ )
        {
            QwtPlot *p = plot( row, col );
            if ( p )
                p->replot();
        }
    }
}
Ejemplo n.º 3
0
	int PlotItem::CalcYExtent (QwtPlot& plot) const
	{
		int result = 0;
		if (BottomAxisEnabled_)
			result += plot.axisScaleDraw (QwtPlot::xBottom)->
					extent (plot.axisFont (QwtPlot::xBottom));
		if (!PlotTitle_.isEmpty ())
			result += plot.titleLabel ()->sizeHint ().height ();
		return result;
	}