I need to know how to make charts/graphs in Blackberry 10 Cascades Beta 3 SDK, QML, Qt, C++. If anyone can show me an example or point me to something that shows me how to do this, it would be much appreciated.
-
Look at this opensource library http://gitorious.org/qtcharts. If you need a well versed commercial edition here is the link http://qt.digia.com/Blogs/Qt-blog/Sami-Makkonen/Dates/2012/4/-Qt-Commercial-Charts-Tech-Preview/. – RajaRaviVarma Oct 25 '12 at 07:04
-
I just discovered that html5 canvas content will render in my Blackberry Cascades 10 Dev Alpha Simulator which runs in VMWare, if the width is no more than 311 and the height is no more than 211. That's a problem. – user1296259 Oct 30 '12 at 16:50
-
Here are a couple of examples of how to draw vector graphics natively: [Using QImage and QPainter](http://supportforums.blackberry.com/t5/Cascades-Development-Knowledge/Using-QImage-and-QPainter-to-Prepare-a-cascades-Image/ta-p/1809841) or [Vector Graphics Drawing with Skia Lib](http://supportforums.blackberry.com/t5/Cascades-Development-Knowledge/Vector-Graphics-Drawing-with-Skia-Lib/ta-p/1887571?CPID=E10C020&Date=101812) – Sunseeker Feb 22 '13 at 00:54
8 Answers
You should check out QChart.js:
http://jwintz.me/blog/2014/02/15/qchart-dot-js-qml-binding-for-chart-dot-js/
https://github.com/jwintz/qchart.js
Update The Qt Company will release QtCharts in 5.7 under GPL http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

- 1,771
- 1
- 15
- 16
-
Correction: Qt Charts will not be available under LGPL, but only GPL. It's in the blog post you are referring to. – Andrej Repiský Jun 15 '16 at 09:20
One way to create graphs im Qt and QML is to add a Webview and use html library to display graphs. I have used flot and found it quite flexible.

- 2,321
- 21
- 30
-
Thankyou, I tried that, and I tried loading graph-types.html from that download into a webview on my Blackberry 10 Dev Alpha Simulator, and it just showed: "Flot Examples" at the top, then a blank section where a graph is supposed to be, and then "Flot supports lines, poins, filled areas, bars and any combinations of these, in the same plot and even on the same data series." below that. It seems it cannot show the graph. – user1296259 Oct 25 '12 at 19:49
-
If you used downloaded version it might be a problem with included js scripts not being seen. You could set their home page as target for webview and check if the graphs are shown. – JuliusG Oct 25 '12 at 21:25
-
No, even when doing that, everything shows, except for the part in the middle where the chart is. – user1296259 Oct 25 '12 at 21:48
-
Not sure then. It definitely works with Webview on desktop environments so should work on blackberry as well – JuliusG Oct 25 '12 at 23:25
-
You could also try [g.raphael](http://g.raphaeljs.com). I found it less flexible but it does not use html canvas so might work. Or some other js graphing library. – JuliusG Oct 26 '12 at 09:46
-
I will look at it, but I suspect it's the Javascript that it cannot handle, because I tried some simple html5 canvas examples from w3schools that had no Javascript, and they rendered just fine in the Blackberry Simulator. Do I need to install a Javascript interpreter somehow into the simulator? - and will that reflect most actual Blackberries where it will eventually have to work? – user1296259 Oct 26 '12 at 15:25
Here is simple QML wrapper for QCustomPlot: https://github.com/ncp1402/ql-lineplot

- 479
- 1
- 5
- 8
This is an old question, but as for me, it was worth to wait.
At this moment there is Qt 5.7.0 Released. Among other new features there are:
- Qt Charts. Previously commercial-only Qt Charts module is now included in Qt under also GPLv3 license for open source users.
- Qt Data Visualization. Previously commercial-only Qt Data Visualization module is now included in Qt under also GPLv3 license for open source users.
If someone is interested, here is good place to start:

- 6,895
- 7
- 45
- 67
As suggested already, use the WebView object to host your graphs library, you'll find way more libraries to use with it than natively.
From personal experience, I can tell that http://www.highcharts.com/ works very well with Playbook OS and Blackberry 10 OS

- 1,414
- 3
- 18
- 37
well i am also looking for solution.
if it is simple plot then maybe you can create ImagePaint with ImagePaintData. very simple example is shown here: https://developer.blackberry.com/cascades/reference/bb_cascades_imagepaint.html
It is also possible to render a chart and seve it as Png for example; Then you could display this as an Image in QML also;
Another option is to use foreign window as described here: https://developer.blackberry.com/cascades/files/webinars/cascades_opengl_webcast.pdf
you could use opengl to render graphics, or try to compile chart library
Well- web browser controll seem like the easiest sollution,and i thinnk that i will try it.
I tried this. Not every Charts library wors on bb10 simulator. For exaple flot , wich was mentioned earlier doesn't work. but some libraries works . for example highCharts and http://elycharts.com/

- 762
- 6
- 21
If you need something in C++ using QT you might have a look at QWT http://qwt.sourceforge.net/index.html

- 2,212
- 1
- 25
- 39
Chart.js 2 is a nice library that offers a ton of different graphs with animations, many options and an easy interface. We have written a QML adapter for it. Qt charts is also nice but it can only be used with GPL or commercial QT license. Our adapter and Chart.js 2 both are MIT-licensed.
Maybe, it's helpful for you and others: https://github.com/Elypson/ChartJs2QML

- 4,016
- 2
- 31
- 51