LineSeries QML Type
以折线图显示数据更多
Import Statement: | import QtCharts 2.9 |
In C++: | QLineSeries |
Inherits: |
属性
详细说明
折线图用于将信息显示为一系列由直线连接的数据点。
下面的 QML 示例展示了如何创建一个简单的折线图:
ChartView { title: "Line Chart" anchors.fill: parent antialiasing: true LineSeries { name: "Line" XYPoint { x: 0; y: 0 } XYPoint { x: 1.1; y: 2.1 } XYPoint { x: 1.9; y: 3.3 } XYPoint { x: 2.1; y: 2.1 } XYPoint { x: 2.9; y: 4.9 } XYPoint { x: 3.4; y: 3.0 } XYPoint { x: 4.1; y: 3.3 } } }
属性文档
capStyle : Qt::PenCapStyle |
控制直线的上限样式。设置为Qt.FlatCap,Qt.SquareCap 或Qt.RoundCap 之一。默认情况下,上限样式为 Qt.SquareCap。
另请参阅 Qt::PenCapStyle 。
count : int |
系列中的数据点数。
style : Qt::PenStyle |
控制线条的样式。设置为Qt.NoPen,Qt.SolidLine,Qt.DashLine,Qt.DotLine,Qt.DashDotLine, 或Qt.DashDotDotLine 之一。QML API 不支持使用Qt.CustomDashLine 。默认情况下,样式为 Qt.SolidLine。
另请参阅 Qt::PenStyle 。
width : real |
线条的宽度。默认情况下,宽度为 2.0。
© 2025 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.