用于 Qt Charts API 的 C++ 类。 更多...
用于专用轴类的基类 | |
用于所有条形系列类的抽象父级类 | |
用于所有 Qt Chart 系列的基类 | |
Legend marker for an area series | |
在区域图表中呈现数据 | |
将类别添加到图表轴 | |
Legend marker for a bar series | |
将一系列数据按类别分组呈现为垂直条形 | |
表示条形图表中的一组条形 | |
Legend marker for a box plot series | |
Presents data in box-and-whiskers charts | |
Represents one item in a box-and-whiskers chart | |
Legend marker for a candlestick series | |
Abstract model mapper class for candlestick series | |
Presents data as candlesticks | |
Represents a single candlestick item in a candlestick chart | |
Places named ranges on the axis | |
管理图表的系列、图例和轴的图形表示 | |
可以显示图表的独立 Widget | |
Displays a color scale as one of the chart's axes | |
Adds dates and times to a chart's axis | |
Horizontal model mapper for bar series | |
Horizontal model mapper for box plot series | |
Horizontal model mapper for a candlestick series | |
Horizontal model mapper for pie series | |
Horizontal model mapper for line, spline, and scatter series | |
Presents a series of data as horizontal bars grouped by category | |
Presents a series of categorized data as a percentage of each category | |
Presents a series of data as horizontally stacked bars, with one bar per category | |
显示图表的图例 | |
Abstract object that can be used to access markers within a legend | |
以线图表形式呈现数据 | |
Adds a logarithmic scale to a chart's axis | |
Presents a series of categorized data as a percentage of each category | |
Legend marker for a pie series | |
Presents data in pie charts | |
Represents a single slice in a pie series | |
Presents data in polar charts | |
Presents data in scatter charts | |
以样条线图表形式呈现数据 | |
Presents a series of data as vertically stacked bars, with one bar per category | |
Vertical model mapper for bar series | |
Vertical model mapper for box plot series | |
Vertical model mapper for a candlestick series | |
Vertical model mapper for pie series | |
Vertical model mapper for line, spline, and scatter series | |
将值添加到图表轴 | |
Legend marker for a line, spline, or scatter series | |
Base class for line, spline, and scatter series |
Charts API 构建于 Qt 图形视图框架之上。Charts 可以显示为 QGraphicsWidget 使用 QChart 类。不管怎样,还有方便类 QChartView ,其是 QWidget 基于。这些使我们能够快速将 Qt Charts 用作正常 Qt 小部件。
若打算在应用程序中使用 Qt Charts C++ 类,使用以下 include 和 using 指令:
#include <QtCharts> using namespace QtCharts;
注意: 采用 Qt Creator 的 Qt Quick 应用程序向导创建的工程是基于 Qt Quick 2 的模板使用 QGuiApplication 默认情况下。所有这种 QGuiApplication 实例在工程中均必须被替换采用 QApplication 因为模块依赖于 Qt 的 图形视图框架 为渲染。
要链接到 Qt Charts 模块,添加此行到
qmake
工程文件:
QT += charts
各图表类型的表示通过 QAbstractSeries 派生类。要创建图表,用户必须使用相关系列类的实例并将它添加到 QChart 实例。
QLineSeries* series = new QLineSeries(); series->append(0, 6); series->append(2, 4); ... chartView->chart()->addSeries(series); chartView->chart()->createDefaultAxes();