Important: Please read the Qt Code of Conduct -

Vertical line on QChartView

  • I have a QChartView containing several series and I would like to add two vertical lines.

    Here is the sample code.
    I guess that since the x point is the same, it won't display. Is there a workaround ?

    QChart *chart = new QChart();
    // Adding some series
    // Series1 and Series2 display properly
    // Trying to add one vertical line
    QLineSeries* VerticalSeries = new QLineSeries();
    VerticalSeries ->append(1.0, -10.0);
    VerticalSeries ->append(1.0, 10.0);

Log in to reply