| 369 | } |
| 370 | |
| 371 | void QmitkChartWidget::Impl::UpdateChartExampleData(const std::vector< std::pair<double, double> >& data2D, |
| 372 | const std::string& label, |
| 373 | const std::string& type, |
| 374 | const std::string& color, |
| 375 | const std::string& lineStyle, |
| 376 | const std::string& pieLabelsData) |
| 377 | { |
| 378 | UpdateData2D(data2D, label); |
| 379 | |
| 380 | auto element = GetDataElementByLabel(label); |
| 381 | if (element) |
| 382 | { |
| 383 | element->SetChartType(QString::fromStdString(type)); |
| 384 | element->SetColor(QString::fromStdString(color)); |
| 385 | element->SetLineStyle(QString::fromStdString(lineStyle)); |
| 386 | |
| 387 | if (pieLabelsData != "") |
| 388 | { |
| 389 | std::string pieLabelsDataWorkingString = pieLabelsData; |
| 390 | |
| 391 | QList<QVariant> pieLabelsDataList; |
| 392 | while (pieLabelsDataWorkingString.size() != 0) |
| 393 | { |
| 394 | QVariant oneElement = QString::fromStdString(pieLabelsDataWorkingString.substr(0, pieLabelsDataWorkingString.find(";"))); |
| 395 | pieLabelsDataList.push_back(oneElement); |
| 396 | |
| 397 | if (pieLabelsDataWorkingString.find(";") != std::string::npos) |
| 398 | { |
| 399 | pieLabelsDataWorkingString.erase(0, pieLabelsDataWorkingString.find(";") + 1); |
| 400 | } |
| 401 | else |
| 402 | { |
| 403 | pieLabelsDataWorkingString.erase(pieLabelsDataWorkingString.begin(), pieLabelsDataWorkingString.end()); |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | element->SetPieLabels(pieLabelsDataList); |
| 408 | } |
| 409 | } |
| 410 | } |
| 411 | |
| 412 | void QmitkChartWidget::Impl::RemoveData(const std::string &label) |
| 413 | { |
no test coverage detected