Qt 5.7 | Qt Charts | Qt Charts C++ Classes

Qt 5.7.1 Reference Documentation

# Qt Charts C++ Classes

C++ classes for the Qt Charts API. More...

## Classes

QAreaSeries | Used for making area charts
QBarCategoryAxis | Used for manipulating chart's axis
QCategoryAxis | Allows putting a named ranges on the axis
QDateTimeAxis | Used for manipulating chart's axis
QLogValueAxis | Used for manipulating chart's axis
QAbstractAxis | Used for manipulating chart's axis
QValueAxis | Used for manipulating chart's axis
QHorizontalBarSeries | Series for creating horizontal bar chart
QHorizontalPercentBarSeries | Series for creating horizontal percent bar chart
QHorizontalStackedBarSeries | Series for creating horizontal stacked bar chart
QAbstractBarSeries | Series for creating a bar chart
QBarSet | Building block for different bar charts
QHBarModelMapper | Horizontal model mapper for bar series
QVBarModelMapper | Vertical model mapper for bar series
QBarSeries | Series for creating bar chart
QPercentBarSeries | Series for creating percent bar chart
QStackedBarSeries | Series for creating stacked bar chart
QBoxPlotSeries | Series for creating box-and-whiskers chart
QBoxSet | Building block for box-and-whiskers chart
QVBoxPlotModelMapper | Vertical model mapper for box plot series
QAreaLegendMarker | QLegendMarker subclass for area series
QBarLegendMarker | QLegendMarker subclass for bar series
QBoxPlotLegendMarker | QLegendMarker subclass for box plot series
QLegend | Legend object
QLegendMarker | LegendMarker object
QPieLegendMarker | QLegendMarker subclass for pie series
QXYLegendMarker | QLegendMarker subclass for QXYSeries
QLineSeries | Used for making line charts
QHPieModelMapper | Horizontal model mapper for pie series
QPieSeries | Pie series API for Qt Charts
QPieSlice | Defines a slice in pie series
QVPieModelMapper | Vertical model mapper for pie series
QAbstractSeries | Base class for all Qt Chart series
QChart | Main chart API for Qt Charts
QChartView | Standalone charting widget
QPolarChart | Polar chart API for Qt Charts
QScatterSeries | Used for making scatter charts
QSplineSeries | Series type used to store data needed to draw a spline
QHXYModelMapper | Horizontal model mapper for QXYSeries
QVXYModelMapper | Vertical model mapper for QXYSeries
QXYSeries | 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.

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.

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