Example #1
0
void Graph::createGraph(const std::string& name, QColor color) {
    if (name.length() > 255) {
        std::cout << "LiveGrapher: Graph::createGraph(): "
                  << "name exceeds 255 characters" << std::endl;
        return;
    }
    m_dataSets.emplace_back();

    QCustomPlot* customPlot = m_window->m_ui->plot;
    customPlot->addGraph();
    customPlot->graph()->setName(QString::fromUtf8(name.c_str()));
    customPlot->graph()->setAntialiasedFill(false);
    customPlot->setNoAntialiasingOnDrag(true);

    QPen pen(color);
    customPlot->graph()->setPen(pen);
}