AbstractSeries QML Type

所有 Qt Charts 系列类型的基础类型。更多

Import Statement: import QtCharts 2.9
In C++: QAbstractSeries
Inherited By:

AbstractBarSeries, AreaSeries, BoxPlotSeries, CandlestickSeries, PieSeries, and XYSeries

属性

详细说明

该类型不能直接实例化。相反,应使用以下派生类型之一来创建系列: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蜡烛图

useOpenGL : bool

指定是否使用 OpenGL 绘制序列。

使用 OpenGL 加速仅支持LineSeriesScatterSeries 。用作AreaSeries 边缘序列的线性序列不能使用 OpenGL 加速。当图表包含任何使用 OpenGL 绘制的序列时,将为ChartView 节点创建一个额外的透明子节点。加速序列不会在ChartView 节点上绘制,而是在子节点上绘制。

使用 OpenGL 加速序列绘制所获得的性能取决于底层硬件,但在大多数情况下都非常显著。例如,在标准台式电脑上,启用 OpenGL 加速通常可以在不降低帧频的情况下多渲染至少上百倍的点。图表大小对帧频的影响也较小。在渲染ChartView 时,最大的性能损失是渲染和上传底层图表纹理。如果底层图表本身没有快速变化,则无需在每一帧中重新生成图表纹理,从而获得显著的额外性能。

OpenGL 加速序列绘制适用于需要快速绘制大量点的用例。它针对效率进行了优化,因此使用它的序列不支持许多非加速序列可用的功能:

  • 加速数列不支持数列动画。
  • 加速数列不支持点标签。
  • 加速数列忽略钢笔样式、标记形状和光标记。只支持实线和普通散点。散点可以是圆形或矩形,具体取决于底层图形硬件和驱动程序。
  • 极坐标图不支持加速序列。
  • 系列的鼠标事件是异步报告的。
  • 使用加速系列时,不建议启用图表阴影或使用透明图表背景色,因为这会大大降低帧频。

默认值为false


visible : bool

系列的可见性。默认情况下,true


© 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.