qt qml qchart 图表组件

qt qml qchart 图表组件

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

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

【先看效果】

qt qml qchart 图表组件

【下载】

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

【调用代码示例】

 import "QChart.js"        as Charts

好了,展示你的图表

     // 折线图
Chart {
id: chart_line;
width: chart_width;
height: chart_height;
chartAnimated: true;
chartAnimationEasing: Easing.InOutElastic;
chartAnimationDuration: 2000;
chartData: ChartsData.ChartLineData;
chartType: Charts.ChartType.LINE;
} // 极坐标图
Chart {
id: chart_polar;
width: chart_width;
height: chart_height;
chartAnimated: true;
chartAnimationEasing: Easing.InBounce;
chartAnimationDuration: 2000;
chartData: ChartsData.ChartPolarData;
chartType: Charts.ChartType.POLAR;
} // 雷达图
Chart {
id: chart_radar;
width: chart_width;
height: chart_height;
chartAnimated: true;
chartAnimationEasing: Easing.OutBounce;
chartAnimationDuration: 2000;
chartData: ChartsData.ChartRadarData;
chartType: Charts.ChartType.RADAR;
} // 饼图
Chart {
id: chart_pie;
width: chart_width;
height: chart_height;
chartAnimated: true;
chartAnimationEasing: Easing.Linear;
chartAnimationDuration: 2000;
chartData: ChartsData.ChartPieData;
chartType: Charts.ChartType.PIE;
} // 柱形图
Chart {
id: chart_bar;
width: chart_width;
height: chart_height;
chartAnimated: true;
chartAnimationEasing: Easing.OutBounce;
chartAnimationDuration: 2000;
chartData: ChartsData.ChartBarData;
chartType: Charts.ChartType.BAR;
} // 环形图
Chart {
id: chart_doughnut;
width: chart_width;
height: chart_height;
chartAnimated: true;
chartAnimationEasing: Easing.OutElastic;
chartAnimationDuration: 2000;
chartData: ChartsData.ChartDoughnutData;
chartType: Charts.ChartType.DOUGHNUT;
}
上一篇:Python In Action:三、再来一个扩展例子,保证不难


下一篇:含有Date和Timestamp的Java和Json互相转化