QML bindings for Charts.js, a simple HTML5 Charts javascript library using the canvas element - chartjs.org.
To give QChart.js a try, just clone this repository and use qmlscene.
$ qmlscene QChartGallery.qmlQt >= 5.0.
This shows how to integrate QChart.js as a jbQuick.Charts submodule into your git project.
$ cd /path/to/project/root/
$ mkdir -p qml/jbQuick
$ git submodule add git://github.com/jwintz/qchart.js.git qml/jbQuick/Charts
$ git commit -a -m "Added QChart.js as a submodule."When cloning a repository with submodules, use:
$ git clone git://your/project/repository.git
$ git submodule init
$ git submodule updateTo update your local submodule, use:
$ git submodule updateAssuming jbQuick is in your qml import path:
import jbQuick.Charts 1.0QChart.js qmldir provides:
ChartQML item inheritingCanvasChartsJavascript library
In addition, Chart provides the following properties:
chartAnimated: whether chart data should be animated on initializationchartAnimationEasing: an easing type enumeration provided to a PropertyAnimationchartAnimationDuration: the length (ms) of the animationchartData: a javascript construct of the data set, see Chart.js documentationchartType: a value amongst:Charts.chartType.BARfor a bar chartCharts.chartType.DOUGHNUTfor a doughnut chartCharts.chartType.LINEfor a line chartCharts.chartType.PIEfor a pie chartCharts.chartType.POLARfor a polar chartCharts.chartType.RADARfor a radar chart
The following snippet creates a line chart.
Chart {
id: chart_line;
width: 400;
height: 400;
chartAnimated: true;
chartAnimationEasing: Easing.InOutElastic;
chartAnimationDuration: 2000;
chartType: Charts.ChartType.LINE;
Component.onCompleted: {
chartData = ...;
}
}You can find Charts.js documentation at chartjs.org/docs.
QChart.js, just as Charts.js, is available under the [MIT license] (http://opensource.org/licenses/MIT).
