이 페이지에서

LineSeries QML Type

데이터를 선 그래프로 표시합니다. 더 보기...

Import Statement: import QtGraphs
In C++: QLineSeries
Inherits:

XYSeries

속성

신호

방법

상세 설명

선 그래프는 직선 또는 단계로 연결된 일련의 데이터 포인트로 정보를 표시하는 데 사용됩니다.

계열은 에서와 같이 NaN 값을 사용하여 간격을 포함할 수 있습니다:

import QtGraphs

GraphsView {
    axisX: ValueAxis {
        max: 5
    }
    axisY: ValueAxis {
        max: 5
    }

    LineSeries {
        color: "#00ff00"
        joinStyle: Qt.RoundJoin

        XYPoint {
            x: 0.5
            y: 0.5
        }

        XYPoint {
            x: 1.1
            y: NaN
        }

        XYPoint {
            x: 1.9
            y: 3.3
        }

        XYPoint {
            x: 2.1
            y: 2.1
        }

        XYPoint {
            x: 5
            y: 4.9
        }
    }
}

또는

QLineSeries *series = new QLineSeries();
series->append(0, 2);
series->append(2, 4);
series->append(3, std::numeric_limits<qreal>::quiet_NaN());
series->append(4, 1);
series->append(5, 0);
series->setLineStyle(QLineSeries::LineStyle::StepCenter);
series->setColor(Qt::red);

와 같이 간격을 포함할 수 있습니다:

참고: 위 예제의 첫 번째 그래프에서 볼 수 있듯이, 계열의 첫 번째 점과 같은 단독 점은 선으로 렌더링되지 않습니다. pointDelegate

LineSeries는 ScatterSeries 와 거의 동일한 API를 사용하므로 자세한 사용 예는 ScatterSeries 문서를 참조하세요.

ScatterSeries도 참조하세요 .

속성 문서

capStyle : Qt::PenCapStyle

줄의 캡 스타일을 제어합니다. Qt.FlatCap , Qt.SquareCap 또는 Qt.RoundCap 중 하나로 설정합니다. 기본적으로 캡 스타일은 Qt.SquareCap입니다. 잘못된 값은 자동으로 기본값으로 설정됩니다.

Qt::PenCapStyle참조하십시오 .

dashOffset : real [since 6.11]

이 속성은 대시 패턴의 시작점을 정의하며, 대시 패턴을 지정하는 데 사용되는 단위로 측정합니다.

기본값은 0 입니다.

이 프로퍼티는 Qt 6.11에 도입되었습니다.

dashPattern : list<real> [since 6.11]

이 속성은 strokeStyleLineSeries::DashLine 으로 설정된 경우 대시 패턴을 정의합니다. 패턴은 1, 3, 5... 항목이 대시이고 2, 4, 6... 항목이 공백인 짝수 양의 항목으로 지정해야 합니다. 패턴은 선 너비 단위로 지정됩니다.

기본값은 (4, 2)로, 4 * width 픽셀의 대시 뒤에 2 * width 픽셀의 공백을 의미합니다.

이 속성은 Qt 6.11에 도입되었습니다.

joinStyle : Qt::PenJoinStyle [since 6.11]

선의 조인 스타일을 제어합니다. Qt.BevelJoin , Qt.MiterJoin 또는 Qt.RoundJoin 중 하나로 설정합니다. 기본적으로 조인 스타일은 Qt.BevelJoin입니다. 유효하지 않은 값은 자동으로 기본값으로 설정됩니다.

이 속성은 Qt 6.11에 도입되었습니다.

Qt::PenJoinStyle참조하십시오 .

lineStyle : QLineSeries::LineStyle [since 6.11]

선의 선 스타일을 제어합니다. LineSeries.Straight , LineSeries.StepLeft, LineSeries.StepRight 또는 LineSeries.StepCenter 중 하나로 설정합니다. 기본적으로 선 스타일은 LineSeries.직선입니다. 잘못된 값은 자동으로 기본값으로 설정됩니다.

이 프로퍼티는 Qt 6.11에 도입되었습니다.

QLineSeries::LineStyle참조하십시오 .

pointDelegate : Component

주어진 QML 컴포넌트로 포인트를 표시합니다.

pointDelegate: Image {
    source: "images/happy_box.png"
}

strokeStyle : enumeration [since 6.11]

상수설명
LineSeries.SolidLine일반 선입니다.
LineSeries.DashLine몇 픽셀로 구분된 대시.

이 프로퍼티는 Qt 6.11에 도입되었습니다.

width : real

선의 너비입니다. 기본적으로 너비는 2.0입니다. 0보다 작은 너비는 유효하지 않으며 자동으로 0으로 설정됩니다.

신호 문서

capStyleChanged()

이 신호는 라인 시리즈 캡 스타일이 변경될 때 발생합니다.

참고: 해당 핸들러는 onCapStyleChanged 입니다.

[since 6.11] dashOffsetChanged(qreal newDashOffset)

이 신호는 라인 계열 라인 대시 오프셋이 변경될 때 발생합니다. newDashOffset 매개변수는 새로운 대시 오프셋을 보유합니다.

참고: 해당 핸들러는 onDashOffsetChanged 입니다.

이 신호는 Qt 6.11에 도입되었습니다.

[since 6.11] dashPatternChanged(QList<qreal> newDashPattern)

이 신호는 라인 계열 라인 대시 패턴이 변경될 때 전송됩니다. newDashPattern 매개변수는 새 대시 패턴을 보유합니다.

참고: 해당 핸들러는 onDashPatternChanged 입니다.

이 신호는 Qt 6.11에 도입되었습니다.

[since 6.11] joinStyleChanged(Qt::PenJoinStyle newJoinStyle)

이 신호는 라인 계열 캡 스타일이 변경될 때 발생합니다. newJoinStyle 매개 변수는 새 조인 스타일을 보유합니다.

참고: 해당 핸들러는 onJoinStyleChanged 입니다.

이 신호는 Qt 6.11에 도입되었습니다.

[since 6.11] lineStyleChanged(QLineSeries::LineStyle newLineStyle)

이 신호는 줄 계열 줄 스타일이 변경될 때 발생합니다. newLineStyle 매개변수는 새 줄 스타일을 보유합니다.

참고: 해당 핸들러는 onLineStyleChanged 입니다.

이 신호는 Qt 6.11에 도입되었습니다.

[since 6.11] strokeStyleChanged(QLineSeries::StrokeStyle newStrokeStyle)

이 신호는 선 계열 획 스타일이 변경될 때 발생합니다. newStrokeStyle 매개변수는 새 획 스타일을 보유합니다.

참고: 해당 핸들러는 onStrokeStyleChanged 입니다.

이 신호는 Qt 6.11에 도입되었습니다.

widthChanged()

이 신호는 선의 직렬 폭이 변경될 때 발생합니다.

참고: 해당 핸들러는 onWidthChanged 입니다.

메서드 문서

point dataPointCoordinatesAt(real x, real y)

데이터 포인트 좌표로 변환된 xy 렌더링 좌표를 반환합니다.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.