How to draw horizontal horizontal line on QCustomPlot?
-
wrote on 27 Sept 2022, 16:36 last edited by
I want to add 2 fixed lines horizontally to the chart. I tried the below Code but it adds the line vertically. How can I make it horizontal?
QCPItemStraightLine *infLine = new QCPItemStraightLine(customPlot); infLine->point1->setCoords(2, 0); // location of point 1 in plot coordinate infLine->point2->setCoords(2, 1); // location of point 2 in plot coordinate
-
Hi,
Fix the coordinates. Twice the same x coordinates will make a vertical line.
-
wrote on 27 Sept 2022, 18:14 last edited by
@SGaist Thank you. It's worked, Can I ask how can I set color for this?
-
From a quick look at the class documentation: setPen.
1/4