首页 > 其他 > 详细

qt qml qchart 图表组件

时间:2015-02-13 19:48:41      阅读:2565      评论:0      收藏:0      [点我收藏+]

qt qml qchart 图表组件

* Author: Julien Wintz
* Created: Thu Feb 13 23:41:59 2014 (+0100)

这玩意是从chart.js迁移到qml的,简单易用好看

【先看效果】

技术分享

【下载】

http://download.csdn.net/detail/surfsky/8426601

【调用代码示例】

1 import "QChart.js"        as Charts

好了,展示你的图表

 1     // 折线图
 2     Chart {
 3       id: chart_line;
 4       width: chart_width;
 5       height: chart_height;
 6       chartAnimated: true;
 7       chartAnimationEasing: Easing.InOutElastic;
 8       chartAnimationDuration: 2000;
 9       chartData: ChartsData.ChartLineData;
10       chartType: Charts.ChartType.LINE;
11     }
12 
13     // 极坐标图
14     Chart {
15       id: chart_polar;
16       width: chart_width;
17       height: chart_height;
18       chartAnimated: true;
19       chartAnimationEasing: Easing.InBounce;
20       chartAnimationDuration: 2000;
21       chartData: ChartsData.ChartPolarData;
22       chartType: Charts.ChartType.POLAR;
23     }
24 
25     // 雷达图
26     Chart {
27       id: chart_radar;
28       width: chart_width;
29       height: chart_height;
30       chartAnimated: true;
31       chartAnimationEasing: Easing.OutBounce;
32       chartAnimationDuration: 2000;
33       chartData: ChartsData.ChartRadarData;
34       chartType: Charts.ChartType.RADAR;
35     }
36 
37     // 饼图
38     Chart {
39       id: chart_pie;
40       width: chart_width;
41       height: chart_height;
42       chartAnimated: true;
43       chartAnimationEasing: Easing.Linear;
44       chartAnimationDuration: 2000;
45       chartData: ChartsData.ChartPieData;
46       chartType: Charts.ChartType.PIE;
47     }
48 
49     // 柱形图
50     Chart {
51       id: chart_bar;
52       width: chart_width;
53       height: chart_height;
54       chartAnimated: true;
55       chartAnimationEasing: Easing.OutBounce;
56       chartAnimationDuration: 2000;
57       chartData: ChartsData.ChartBarData;
58       chartType: Charts.ChartType.BAR;
59     }
60 
61     // 环形图
62     Chart {
63       id: chart_doughnut;
64       width: chart_width;
65       height: chart_height;
66       chartAnimated: true;
67       chartAnimationEasing: Easing.OutElastic;
68       chartAnimationDuration: 2000;
69       chartData: ChartsData.ChartDoughnutData;
70       chartType: Charts.ChartType.DOUGHNUT;
71     }

 

qt qml qchart 图表组件

原文:http://www.cnblogs.com/surfsky/p/4290739.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!