用於 Qt Charts API 的 C++ 類。 更多...
This module is deprecated since 6.10. We strongly advise against using it in new code.
| 用於專用軸類的基類 | |
| 用於所有條形係列類的抽象父級類 | |
| 用於所有 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 |
使用 QtGraphs 代替。
Charts API 構建於 Qt 圖形視圖框架之上。Charts 可以顯示為 QGraphicsWidget 使用 QChart 類。不管怎樣,還有方便類 QChartView ,其是 QWidget 基於。這些使我們能夠快速將 Qt Charts 用作正常 Qt 小部件。
注意: The Qt Charts module has been deprecated since Qt 6.10. For new projects, use the Qt Graphs module instead. Qt Graphs uses each platform's native rendering backend (Metal on macOS, DirectX on Windows, OpenGL or Vulkan on Linux) to achieve hardware-accelerated rendering for both 2D and 3D graphs. Qt Graphs uses Qt Quick 形狀 for 2D graph rendering, instead of the outdated Qt Graphics View Framework used by the Qt Charts module. To migrate from Qt Charts to Qt Graphs module, refer to Qt Graphs Migration from Qt Charts .
Using a Qt module's C++ API requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake.
注意: 采用 Qt Creator 的 Qt Quick 應用程序嚮導創建的工程是基於 Qt Quick 2 的模闆使用 QGuiApplication 默認情況下。所有這種 QGuiApplication 實例在工程中均必須被替換采用 QApplication 因為模塊依賴於 Qt 的 圖形視圖框架 為渲染。
要將模塊用於 CMake,使用
find_package()
命令定位所需模塊組件在
Qt6
包:
find_package(Qt6 COMPONENTS Charts REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Charts)
要采用 qmake 構建模塊,將模塊添加作為值對於
QT
變量在工程的 .pro 文件:
QT += charts
各圖錶類型的錶示通過 QAbstractSeries 派生類。要創建圖錶,用戶必須使用相關係列類的實例並將它添加到 QChart 實例。
QLineSeries* series = new QLineSeries(); series->append(0, 6); series->append(2, 4); ... chartView->chart()->addSeries(series); chartView->chart()->createDefaultAxes();