QPolarChart Class
QPolarChart 用于以极坐标图的形式呈现数据。更多内容...
| Header: | #include <QPolarChart> |
| Inherits: | QChart |
| Status: | Deprecated |
该类已弃用。我们强烈建议不要在新代码中使用它。
公共类型
| enum | PolarOrientation { PolarOrientationRadial, PolarOrientationAngular } |
| flags | PolarOrientations |
公共函数
| QPolarChart(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = Qt::WindowFlags()) | |
| virtual | ~QPolarChart() |
| void | addAxis(QAbstractAxis *axis, QPolarChart::PolarOrientation polarOrientation) |
| QList<QAbstractAxis *> | axes(QPolarChart::PolarOrientations polarOrientation = PolarOrientations(PolarOrientationRadial | PolarOrientationAngular), QAbstractSeries *series = nullptr) const |
静态公共成员
| QPolarChart::PolarOrientation | axisPolarOrientation(QAbstractAxis *axis) |
详细说明
极坐标图以圆形图表呈现数据,其中数据的位置基于与图表中心(即极点)的夹角和距离。

极坐标图是QChart 的特殊类型,支持线型、样条、面积和散点系列,以及它们支持的所有轴类型。每个轴均可作为径向轴或角度轴使用。
角度型QValueAxis 上的第一个和最后一个刻度标记位于 0/360 度角处。
如果系列中两个相邻点之间的角距离超过 180 度,连接这两个点的任何直线将失去意义,因此不会被绘制。取而代之的是,将绘制一条从图表中心出发并返回中心线。因此,在显示线型、样条曲线或面积系列时,必须相应地选择坐标轴范围。
极坐标图会将所有同向坐标轴绘制在相同位置,因此使用多个同向坐标轴可能会造成混淆,除非这些额外坐标轴仅用于自定义网格。例如,您可以使用带阴影效果的辅助坐标轴(QCategoryAxis )来突出显示某个范围,或者通过带有隐藏标签的辅助坐标轴(QValueAxis )提供无标签的子刻度。
另请参阅 QChart 。
成员类型文档
enum QPolarChart::PolarOrientation
flags QPolarChart::PolarOrientations
此枚举类型指定了轴的极坐标方向。
| 常量 | 值 | 描述 |
|---|---|---|
QPolarChart::PolarOrientationRadial | 0x1 | 径向轴,其值沿图表半径方向排列,从极点开始。 |
QPolarChart::PolarOrientationAngular | 0x2 | 一个角度轴,其值围绕图表排列。 |
PolarOrientations 类型是QFlags<PolarOrientation> 的 typedef 定义。它存储 PolarOrientation 值的按“或”运算组合。
成员函数文档
[explicit] QPolarChart::QPolarChart(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = Qt::WindowFlags())
创建一个极坐标图表,并将其作为parent 的子对象。由wFlags 指定的属性将传递给QChart构造函数。
[virtual noexcept] QPolarChart::~QPolarChart()
删除极坐标图对象及其子对象,例如添加到该对象上的系列和坐标轴对象。
void QPolarChart::addAxis(QAbstractAxis *axis, QPolarChart::PolarOrientation polarOrientation)
此便捷方法将坐标轴 `axis ` 添加到极坐标图中,其极坐标方向为 `polarOrientation`。该图表将拥有该坐标轴的所有权。
注意: 也可以使用 `QChart::addAxis()` 向极坐标图添加坐标轴 。指定的对齐方式决定了极坐标方向:水平对齐表示角坐标轴,垂直对齐表示径向坐标轴。
另请参阅 QChart::removeAxis()、QChart::createDefaultAxes()、QAbstractSeries::attachAxis() 以及QChart::addAxis()。
QList<QAbstractAxis *> QPolarChart::axes(QPolarChart::PolarOrientations polarOrientation = PolarOrientations(PolarOrientationRadial | PolarOrientationAngular), QAbstractSeries *series = nullptr) const
返回为序列series 添加的、具有极坐标方向polarOrientation 的坐标轴。如果未提供序列,则返回任何具有指定极坐标方向的坐标轴。
另请参阅 addAxis()。
[static] QPolarChart::PolarOrientation QPolarChart::axisPolarOrientation(QAbstractAxis *axis)
极坐标图中的角轴表示水平方向,而半径轴表示垂直方向。此函数是一个便捷函数,用于将坐标轴axis 的方向转换为相应的极坐标方向。如果axis 为空或未添加到极坐标图中,则返回值无意义。
© 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.