IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Qt Charts C++ Classes

C++ classes for the Qt Charts API.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Qt Charts C++ Classes

C++ classes for the Qt Charts API.

Classes

  • QAbstractAxis: The QAbstractAxis class is a base class used for specialized axis classes.

  • QAbstractBarSeries: The QAbstractBarSeries class is an abstract parent class for all bar series classes.

  • QAbstractSeries: The QAbstractSeries class is a base class for all Qt Chart series.

  • QAreaLegendMarker: The QAreaLegendMarker class is a legend marker for an area series.

  • QAreaSeries: The QAreaSeries class presents data in area charts.

  • QBarCategoryAxis: The QBarCategoryAxis class adds categories to a chart's axes.

  • QBarLegendMarker: The QBarLegendMarker class is a legend marker for a bar series.

  • QBarSeries: The QBarSeries class presents a series of data as vertical bars grouped by category.

  • QBarSet: The QBarSet class represents one set of bars in a bar chart.

  • QBoxPlotLegendMarker: The QBoxPlotLegendMarker class is a legend marker for a box plot series.

  • QBoxPlotSeries: The QBoxPlotSeries class presents data in box-and-whiskers charts.

  • QBoxSet: The QBoxSet class represents one item in a box-and-whiskers chart.

  • QCandlestickLegendMarker: The QCandlestickLegendMarker class is a legend marker for a candlestick series.

  • QCandlestickModelMapper: Abstract model mapper class for candlestick series.

  • QCandlestickSeries: The QCandlestickSeries class presents data as candlesticks.

  • QCandlestickSet: The QCandlestickSet class represents a single candlestick item in a candlestick chart.

  • QCategoryAxis: The QCategoryAxis class places named ranges on the axis.

  • QChart: The QChart class manages the graphical representation of the chart's series, legends, and axes.

  • QChartView: The QChartView is a standalone widget that can display charts.

  • QColorAxis: The QColorAxis class displays a color scale as one of the chart's axes.

  • QDateTimeAxis: The QDateTimeAxis class adds dates and times to a chart's axis.

  • QHBarModelMapper: The QHBarModelMapper class is a horizontal model mapper for bar series.

  • QHBoxPlotModelMapper: The QHBoxPlotModelMapper class is a horizontal model mapper for box plot series.

  • QHCandlestickModelMapper: The QHCandlestickModelMapper class is a horizontal model mapper for a candlestick series.

  • QHPieModelMapper: The QHPieModelMapper is a horizontal model mapper for pie series.

  • QHXYModelMapper: The QHXYModelMapper class is a horizontal model mapper for line, spline, and scatter series.

  • QHorizontalBarSeries: The QHorizontalBarSeries class presents a series of data as horizontal bars grouped by category.

  • QHorizontalPercentBarSeries: The QHorizontalPercentBarSeries class presents a series of categorized data as a percentage of each category.

  • QHorizontalStackedBarSeries: The QHorizontalStackedBarSeries class presents a series of data as horizontally stacked bars, with one bar per category.

  • QLegend: The QLegend class displays the legend of a chart.

  • QLegendMarker: The QLegendMarker class is an abstract object that can be used to access markers within a legend.

  • QLineSeries: The QLineSeries class presents data in line charts.

  • QLogValueAxis: The QLogValueAxis class adds a logarithmic scale to a chart's axis.

  • QPercentBarSeries: The QPercentBarSeries class presents a series of categorized data as a percentage of each category.

  • QPieLegendMarker: The QPieLegendMarker class is a legend marker for a pie series.

  • QPieSeries: The QPieSeries class presents data in pie charts.

  • QPieSlice: The QPieSlice class represents a single slice in a pie series.

  • QPolarChart: The QPolarChart presents data in polar charts.

  • QScatterSeries: The QScatterSeries class presents data in scatter charts.

  • QSplineSeries: The QSplineSeries class presents data as spline charts.

  • QStackedBarSeries: The QStackedBarSeries class presents a series of data as vertically stacked bars, with one bar per category.

  • QVBarModelMapper: The QVBarModelMapper class is a vertical model mapper for bar series.

  • QVBoxPlotModelMapper: The QVBoxPlotModelMapper is a vertical model mapper for box plot series.

  • QVCandlestickModelMapper: The QVCandlestickModelMapper class is a vertical model mapper for a candlestick series.

  • QVPieModelMapper: The QVPieModelMapper is a vertical model mapper for pie series.

  • QVXYModelMapper: The QVXYModelMapper class is a vertical model mapper for line, spline, and scatter series.

  • QValueAxis: The QValueAxis class adds values to a chart's axes.

  • QXYLegendMarker: The QXYLegendMarker class is a legend marker for a line, spline, or scatter series.

  • QXYSeries: The QXYSeries class is a base class for line, spline, and scatter series.

Detailed Description

Charts API is built on top of Qt Graphics View Framework. Charts can be displayed as QGraphicsWidget using the QChart class. However there is also the convenience class QChartView, which is QWidget based. These enable us to quickly use Qt Charts as a normal Qt widget.

If you intend to use Qt Charts C++ classes in your application, use the following include and using directives:

 
Sélectionnez
#include <QtCharts>

using namespace QtCharts;

Projects created with Qt Creator's Qt Quick Application wizard are based on the Qt Quick 2 template that uses QGuiApplication by default. All such QGuiApplication instances in the project must be replaced with QApplication as the module depends on Qt's Graphics View Framework for rendering.

To link against the Qt Charts module, add this line to your qmake project file:

 
Sélectionnez
QT += charts

Each chart type is represented by the QAbstractSeries derived class. To create charts, the users have to use an instance of the related series class and add it to a QChart instance.

 
Sélectionnez
QLineSeries* series = new QLineSeries();
series->append(0, 6);
series->append(2, 4);
...
chartView->chart()->addSeries(series);
chartView->chart()->createDefaultAxes();

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+