QCustomPlot Discussion and Comments

How to get size of QCPItemTextReturn to overview

Hi!
I need to place my QCPItemText depending on its height. Is it possible?
For example: myLabel->position->setCoords(5000, 50 + height);

Thank you!

You should simply set the position alignment to be at the top I think. setPositionAlignment

Not really understand you...

Vertical line [second graph]:

ui->MyPlot->addGraph();
ui->MyPlot->graph(1)->setName("Vertical line");
ui->MyPlot->graph(1)->setLineStyle(QCPGraph::lsLine);
ui->MyPlot->graph(1)->data()->clear();
ui->MyPlot->graph(1)->addData(5000, 0);
ui->MyPlot->graph(1)->addData(5000, 50);

I need to draw a tag over the vertical line.

My tag:

MyTag = new QCPItemText(ui->MyPlot);
MyTag ->setPositionAlignment(Qt::AlignTop|Qt::AlignHCenter);
MyTag ->position->setType(QCPItemPosition::ptPlotCoords);
MyTag ->setColor(QColor(Qt::black));
MyTag ->position->setCoords(5000, 50);

How to do this correctly?

if you are using height in pixels, you need to set the type of the y to pixels instead of plot coords. otherwise, you are putting it at 50 in plot coords.

No, I using plot coords.