MCPcopy Create free account
hub / github.com/MITK/MITK / UpdateChartExampleData

Method UpdateChartExampleData

Modules/Chart/src/QmitkChartWidget.cpp:371–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371void 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
412void QmitkChartWidget::Impl::RemoveData(const std::string &label)
413{

Callers 1

UpdateDataMethod · 0.80

Calls 9

SetChartTypeMethod · 0.45
SetColorMethod · 0.45
SetLineStyleMethod · 0.45
sizeMethod · 0.45
findMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
SetPieLabelsMethod · 0.45

Tested by

no test coverage detected