MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / setLegendPosition

Method setLegendPosition

3rdparty/qwt/src/qwt_plot_layout.cpp:1183–1217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1181 */
1182
1183void QwtPlotLayout::setLegendPosition( QwtPlot::LegendPosition pos, double ratio )
1184{
1185 if ( ratio > 1.0 )
1186 ratio = 1.0;
1187
1188 LayoutEngine& engine = m_data->engine;
1189
1190 switch ( pos )
1191 {
1192 case QwtPlot::TopLegend:
1193 case QwtPlot::BottomLegend:
1194 {
1195 if ( ratio <= 0.0 )
1196 ratio = 0.33;
1197
1198 engine.setLegendRatio( ratio );
1199 engine.setLegendPos( pos );
1200
1201 break;
1202 }
1203 case QwtPlot::LeftLegend:
1204 case QwtPlot::RightLegend:
1205 {
1206 if ( ratio <= 0.0 )
1207 ratio = 0.5;
1208
1209 engine.setLegendRatio( ratio );
1210 engine.setLegendPos( pos );
1211
1212 break;
1213 }
1214 default:
1215 break;
1216 }
1217}
1218
1219/*!
1220 \brief Specify the position of the legend

Callers 2

insertLegendMethod · 0.45
insertLegendMethod · 0.45

Calls 2

setLegendPosMethod · 0.80
setLegendRatioMethod · 0.45

Tested by

no test coverage detected