Qt Charts QML Types

The Qt Charts QML API is an intuitive and simple way to show charts in your QML applications.

Use the following QML to create a simple pie chart:

 import QtQuick 2.0
 import QtCharts 2.0

 ChartView {
     width: 400
     height: 300
     theme: ChartView.ChartThemeBrownSand
     antialiasing: true

     PieSeries {
         id: pieSeries
         PieSlice { label: "eaten"; value: 94.9 }
         PieSlice { label: "not yet eaten"; value: 5.1 }
     }
 }

Note: Since Qt Creator 3.0 the project created with Qt Quick Application wizard based on Qt Quick 2 template uses QGuiApplication by default. As Qt Charts utilizes Qt Graphics View Framework for drawing, QApplication must be used. The project created with the wizard is usable with Qt Charts after the QGuiApplication is replaced with QApplication.

QML Types

AbstractAxis

A base type used for specialized axis types

AbstractBarSeries

An abstract parent type for all bar series types

AbstractSeries

Base type for all Qt Chart series types

AreaSeries

Presents data in area charts

BarCategoryAxis

Adds categories to a chart's axes

BarSeries

Presents a series of data as vertical bars grouped by category

BarSet

Represents one set of bars in a bar chart

BoxPlotSeries

Presents data in box-and-whiskers charts

BoxSet

Represents one item in a box-and-whiskers chart

CandlestickSeries

Represents a series of data as candlesticks

CandlestickSet

Represents a single candlestick item in a candlestick chart

CategoryAxis

Places named ranges on the axis

CategoryRange

Defines a range on a category axis

ChartView

Manages the graphical representation of the chart's series, legends, and axes

DateTimeAxis

Adds dates and times to a chart's axis

HBarModelMapper

Horizontal model mapper for bar series

HBoxPlotModelMapper

Horizontal model mapper for box plot series

HCandlestickModelMapper

Horizontal model mapper for a candlestick series

HPieModelMapper

Horizontal model mapper for pie series

HXYModelMapper

A horizontal model mapper for XYSeries

HorizontalBarSeries

Presents a series of data as horizontal bars grouped by category

HorizontalPercentBarSeries

Presents a series of categorized data as a percentage of each category

HorizontalStackedBarSeries

Presents a series of data as stacked horizontal bars, with one bar per category

Legend

Displays the legend of a chart

LineSeries

Presents data in line charts

LogValueAxis

Adds a logarithmic scale to a chart's axis

Margins

Defines margins between the edge of the chart rectangle and the plot area

PercentBarSeries

Presents a series of categorized data as a percentage of each category

PieSeries

Presents data in pie charts

PieSlice

Represents a single slice in a pie series

PolarChartView

Presents data in polar charts

ScatterSeries

Type presents data in scatter charts

SplineSeries

Presents data as spline charts

StackedBarSeries

Presents a series of data as vertically stacked bars, with one bar per category

VBarModelMapper

Vertical model mapper for bar series

VBoxPlotModelMapper

Vertical model mapper for box plot series

VCandlestickModelMapper

Vertical model mapper for a candlestick series

VPieModelMapper

Vertical model mapper for pie series

VXYModelMapper

A vertical model mapper for XYSeries

ValueAxis

Adds values to a chart's axes

XYPoint

Initializes XY-series coordinate data

XYSeries

A base type for line, spline, and scatter series