26 stationView->setRenderHints(QPainter::Antialiasing);
72 stationView->setRenderHints(QPainter::Antialiasing);
74 std::vector<DiagramList*> lists;
77 for (
auto& list : lists)
79 stationView->addGraph(list);
88 stationView->setRenderHints(QPainter::Antialiasing);
89 stationView->addGraph(list);
97 std::size_t nEntries = data.size();
98 std::vector<std::pair<float, float>> list_data(nEntries);
100 for (std::size_t i = 0; i < nEntries; i++)
102 list_data.emplace_back(
static_cast<float>(i),
103 static_cast<float>(data[i]));
107 list->setList(list_data);
108 list->setXUnit(
"Value");
109 list->setYUnit(
"Amount");
110 list->setName(
"Histogram");
111 stationView->setRenderHints(QPainter::Antialiasing);
112 stationView->addGraph(list);
125 int width = (stationView->getWidth() > 800) ? 800 : stationView->getWidth();
127 (stationView->getHeight() > 600) ? 600 : stationView->getHeight();
128 resize(width, height);
134 QColor colour(c[0], c[1], c[2]);
142 this->stationView->addGraph(list);
148 QString fileName = QFileDialog::getOpenFileName(
149 this,
"Select data file to open",
150 settings.value(
"lastOpenedFileDirectory").toString(),
151 "Text files (*.txt);;All files (* *.*)");
152 if (!fileName.isEmpty())
154 QDir dir = QDir(fileName);
155 settings.setValue(
"lastOpenedFileDirectory", dir.absolutePath());
157 prefs->setAttribute(Qt::WA_DeleteOnClose);
Definition of the Color class.
Definition of the DetailWindow class.
Definition of the DiagramPrefsDialog class.
void on_addDataButton_clicked()
void on_closeButton_clicked()
void resizeWindow()
Automatically resize window based on the measurements of the included graphs.
DetailWindow(QWidget *parent=nullptr)
Creates an empty diagram window.
void addList(DiagramList *list)
A List of data points and all the necessary meta-information to draw a graph.
static int readList(const QString &path, std::vector< DiagramList * > &list)
void setColor(QColor c)
Sets the colour of the graph.
A dialog that allows for setting preferences for a requested diagram.
Color getRandomColor()
Returns a random RGB colour.
std::array< unsigned char, 4 > Color