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

Base element used for specialized axis elements

AbstractBarSeries

Series type for creating a bar chart

AbstractSeries

Base class for all Qt Chart series

AreaSeries

Type is used for making area charts

BarCategoryAxis

Axis element is used for manipulating chart's axes

BarSeries

Series for creating bar chart

BarSet

Building block for different bar charts

BoxPlotSeries

Series for creating box-and-whiskers chart

BoxSet

Building block for box-and-whiskers chart

CategoryAxis

Allows putting a named ranges on the axis

CategoryRange

With CategoryRange you can define a range used by a CategoryAxis

ChartView

Chart element

DateTimeAxis

Element is used for manipulating chart's axes

HBarModelMapper

Horizontal model mapper for bar series

HPieModelMapper

Horizontal model mapper for pie series

HXYModelMapper

Horizontal model mapper for QXYSeries

HorizontalBarSeries

Series type for creating horizontal bar chart

HorizontalPercentBarSeries

Series type for creating horizontal precent bar chart

HorizontalStackedBarSeries

Series type for creating horizontal stacked bar chart

Legend

Part of Qt Chart QML API

LineSeries

Type is used for making line charts

LogValueAxis

Element is used for manipulating chart's axes

Margins

Type is used to define margins

PercentBarSeries

Series for creating persent bar chart

PieSeries

Type is used for making pie charts

PieSlice

Defines a slice in pie series

PolarChartView

Polar chart element

ScatterSeries

Type is used for making scatter charts

SplineSeries

Type is used for making spline charts

StackedBarSeries

Series for creating stacked bar chart

VBarModelMapper

Vertical model mapper for bar series

VBoxPlotModelMapper

Vertical model mapper for box plot series

VPieModelMapper

Vertical model mapper for pie series

VXYModelMapper

Vertical model mapper for QXYSeries

ValueAxis

Element is used for manipulating chart's axes

XYPoint

Type is used to initialize XY-series coordinate data

XYSeries

Type is a base type for line, spline and scatter series