! * 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. */
| 283 | * the new spreadsheet is added to the current folder. |
| 284 | */ |
| 285 | void 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 |
nothing calls this directly
no test coverage detected