MCPcopy Create free account
hub / github.com/KDE/labplot / createDataSpreadsheet

Method createDataSpreadsheet

src/backend/worksheet/plots/cartesian/BoxPlot.cpp:285–320  ·  view source on GitHub ↗

! * creates a new spreadsheet having the data with the positions and the values of the bins. * the new spreadsheet is added to the current folder. */

Source from the content-addressed store, hash-verified

283 * the new spreadsheet is added to the current folder.
284 */
285void BoxPlot::createDataSpreadsheet() {
286 if (dataColumns().isEmpty())
287 return;
288
289 // create a new spreadsheet for the following 9 metrics:
290 // index
291 // 1st quartile
292 // 3rd quartile
293 // median
294 // whiskers min
295 // whiskers max
296 // data points count
297 // outliers count
298 // far out points count
299
300 auto* spreadsheet = new Spreadsheet(i18n("%1 - Data", name()));
301 spreadsheet->setColumnCount(9);
302 spreadsheet->setRowCount(dataColumns().count());
303 spreadsheet->column(0)->setColumnMode(AbstractColumn::ColumnMode::Integer);
304
305 spreadsheet->column(0)->setName(i18n("index"));
306 spreadsheet->column(1)->setName(i18n("1st quartile"));
307 spreadsheet->column(2)->setName(i18n("3rd quartile"));
308 spreadsheet->column(3)->setName(i18n("median"));
309 spreadsheet->column(4)->setName(i18n("whiskers min"));
310 spreadsheet->column(5)->setName(i18n("whiskers max"));
311 spreadsheet->column(6)->setName(i18n("data points count"));
312 spreadsheet->column(7)->setName(i18n("outliers count"));
313 spreadsheet->column(8)->setName(i18n("far out points count"));
314
315 Q_D(const BoxPlot);
316 d->fillDataSpreadsheet(spreadsheet);
317
318 // add the new spreadsheet to the current folder
319 folder()->addChild(spreadsheet);
320}
321
322/* ============================ getter methods ================= */
323// general

Callers

nothing calls this directly

Calls 9

fillDataSpreadsheetMethod · 0.80
isEmptyMethod · 0.45
setColumnCountMethod · 0.45
setRowCountMethod · 0.45
countMethod · 0.45
setColumnModeMethod · 0.45
columnMethod · 0.45
setNameMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected