AbstractSeries QML Type
所有 Qt Charts 系列类型的基类。更多...
| Import Statement: | import QtCharts 2.12 |
| In C++: | QAbstractSeries |
| Inherited By: | |
| Status: | Deprecated |
此类型已弃用。我们强烈建议不要在新代码中使用它。
属性
详细说明
此类无法直接实例化。应使用以下派生类型之一来创建序列:LineSeries 、AreaSeries 、BarSeries 、StackedBarSeries 、PercentBarSeries 、HorizontalBarSeries 、HorizontalStackedBarSeries 、HorizontalPercentBarSeries 、PieSeries 、ScatterSeries 、SplineSeries 、BoxPlotSeries 或CandlestickSeries 。
属性文档
name : string
该系列的名称。它将显示在该系列的图例中,并支持 HTML 格式。
opacity : real
系列的透明度。默认情况下,透明度为 1.0。有效值范围为 0.0(透明)到 1.0(不透明)。
type : enumeration [read-only]
数组的类型。
| 常量 | 描述 |
|---|---|
AbstractSeries.SeriesTypeLine | 折线图。 |
AbstractSeries.SeriesTypeArea | 面积图。 |
AbstractSeries.SeriesTypeBar | 竖条形图。 |
AbstractSeries.SeriesTypeStackedBar | 竖向堆叠条形图。 |
AbstractSeries.SeriesTypePercentBar | 竖条百分比图。 |
AbstractSeries.SeriesTypePie | 饼图。 |
AbstractSeries.SeriesTypeScatter | 散点图。 |
AbstractSeries.SeriesTypeSpline | 样条图。 |
AbstractSeries.SeriesTypeHorizontalBar | 水平条形图。 |
AbstractSeries.SeriesTypeHorizontalStackedBar | 水平堆叠条形图。 |
AbstractSeries.SeriesTypeHorizontalPercentBar | 水平百分比条形图。 |
AbstractSeries.SeriesTypeBoxPlot | 箱线图。 |
AbstractSeries.SeriesTypeCandlestick | K线图。 |
useOpenGL : bool
指定该系列是否使用 OpenGL 绘制。
仅支持对 LineSeries 和 ScatterSeries 使用 OpenGL 加速。 用作 AreaSeries 边界系列的线系列无法使用 OpenGL 加速。当图表中包含任何使用 OpenGL 绘制的系列时,会为 ChartView 节点创建一个额外的透明子节点。经过加速的系列不会绘制在 ChartView 节点上,而是绘制在该子节点上。
使用 OpenGL 加速系列绘制所带来的性能提升取决于底层硬件,但在大多数情况下提升非常显著。例如,在标准台式计算机上,为某个系列启用 OpenGL 加速通常可以在不降低帧率的情况下,渲染至少多出百倍的数据点。图表大小对帧率的影响也较小。 渲染 ChartView 时最大的性能消耗来自底层图表纹理的渲染和上传。如果底层图表本身变化不快,由于无需为每一帧重新生成图表纹理,因此能获得显著的额外性能提升。
系列绘制的 OpenGL 加速旨在满足需要快速绘制大量数据点的使用场景。该功能经过效率优化,因此使用该功能的系列不支持非加速系列所具备的许多功能:
- 加速系列不支持系列动画。
- 加速系列不支持数据点标签。
- 对于加速系列,笔触样式、标记形状和浅色标记将被忽略。仅支持实线和普通散点。散点可以是圆形或矩形,具体取决于底层图形硬件和驱动程序。
- 极坐标图不支持加速系列。
- 数据系列的相关鼠标事件将异步报告。
- 使用加速数据系列时,不建议启用图表阴影或使用透明的图表背景色,因为这会显著降低帧率。
默认值为false 。
visible : bool
系列的可见性。默认情况下,true 。
© 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.