简体   繁体   English

如何在C++、Qt、QML、Blackberry 10 Cascades Beta 3 SDK中制作图表/图形(如折线图、条形图、圆形图)等?

[英]How to make charts/graphs (such as line graphs, bar graphs, circle graphs), etc. in C++, Qt, QML, Blackberry 10 Cascades Beta 3 SDK?

I need to know how to make charts/graphs in Blackberry 10 Cascades Beta 3 SDK, QML, Qt, C++.我需要知道如何在 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.如果有人可以向我展示一个例子或向我指出一些向我展示如何做到这一点的东西,我将不胜感激。

One way to create graphs im Qt and QML is to add a Webview and use html library to display graphs.在 Qt 和 QML 中创建图形的一种方法是添加一个 Webview 并使用 html 库来显示图形。 I have used flot and found it quite flexible.我使用过Flot并发现它非常灵活。

这是 QCustomPlot 的简单 QML 包装器: https : //github.com/ncp1402/ql-lineplot

This is an old question, but as for me, it was worth to wait.这是一个老问题,但对我来说,值得等待。

At this moment there is Qt 5.7.0 Released .此时有Qt 5.7.0 Released Among other new features there are:其他新功能包括:

  • Qt Charts . Qt 图表 Previously commercial-only Qt Charts module is now included in Qt under also GPLv3 license for open source users.以前仅用于商业用途的 Qt Charts 模块现在也包含在 Qt 中,同时也是针对开源用户的 GPLv3 许可。

Qt图表。图片引起注意

  • Qt Data Visualization . Qt 数据可视化 Previously commercial-only Qt Data Visualization module is now included in Qt under also GPLv3 license for open source users.以前仅用于商业用途的 Qt 数据可视化模块现在也包含在 Qt 中,并且还遵循面向开源用户的 GPLv3 许可。

Qt 数据可视化。图片引起注意

If someone is interested, here is good place to start:如果有人感兴趣,这里是一个很好的起点:

As suggested already, use the WebView object to host your graphs library, you'll find way more libraries to use with it than natively.正如已经建议的那样,使用 WebView 对象来托管您的图形库,您会找到比原生更多的库来使用它。

From personal experience, I can tell that http://www.highcharts.com/ works very well with Playbook OS and Blackberry 10 OS根据个人经验,我可以看出http://www.highcharts.com/在 Playbook OS 和 Blackberry 10 OS 上运行良好

well i am also looking for solution.好吧,我也在寻找解决方案。

if it is simple plot then maybe you can create ImagePaint with ImagePaintData.如果它是简单的绘图,那么也许您可以使用 ImagePaintData 创建 ImagePaint。 very simple example is shown here: https://developer.blackberry.com/cascades/reference/bb_ cascades _imagepaint.html很简单的例子如下所示: https://developer.blackberry.com/cascades/reference/bb_级联_imagepaint.html

It is also possible to render a chart and seve it as Png for example;例如,也可以渲染图表并将其设置为 Png; Then you could display this as an Image in QML also;然后您也可以将其显示为 QML 中的图像;

Another option is to use foreign window as described here: https://developer.blackberry.com/cascades/files/webinars/cascades_opengl_webcast.pdf另一种选择是使用此处所述的外部窗口: https : //developer.blackberry.com/cascades/files/webinars/cascades_opengl_webcast.pdf

you could use opengl to render graphics, or try to compile chart library你可以使用opengl来渲染图形,或者尝试编译图表库

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.并非每个 Charts 库都适用于 bb10 模拟器。 For exaple flot , wich was mentioned earlier doesn't work.例如, flot ,前面提到的不起作用。 but some libraries works .但有些图书馆有效。 for example highCharts and http://elycharts.com/例如 highCharts 和http://elycharts.com/

如果您需要使用 QT 的 C++ 内容,您可以查看 QWT http://qwt.sourceforge.net/index.html

Chart.js 2 is a nice library that offers a ton of different graphs with animations, many options and an easy interface. Chart.js 2 是一个不错的库,它提供了大量带有动画的不同图形、许多选项和简单的界面。 We have written a QML adapter for it.我们已经为它编写了一个 QML 适配器。 Qt charts is also nice but it can only be used with GPL or commercial QT license. Qt 图表也不错,但它只能与 GPL 或商业 QT 许可证一起使用。 Our adapter and Chart.js 2 both are MIT-licensed.我们的适配器和 Chart.js 2 都是 MIT 许可的。

Maybe, it's helpful for you and others: https://github.com/Elypson/ChartJs2QML也许,它对你和其他人有帮助: https : //github.com/Elypson/ChartJs2QML

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM