回答
我是拉斐爾(http://raphaeljs.com/)最終會被納入煎茶觸摸它的構圖組件(http://g.raphaeljs.com/)的印象。在此之前,您可以非常輕鬆地添加額外的Raphael .js文件並以此方式製作圖形。例如:
<script src="sencha-touch-1.0/sencha-touch-debug.js" type="text/javascript" charset="utf-8"></script>
<!-- Raphael JS -->
<script src="raphael/raphael-min.js" type="text/javascript" charset="utf-8"></script>
<script src="raphael/g.raphael-min.js" type="text/javascript" charset="utf-8"></script>
<script src="raphael/g.pie-min.js" type="text/javascript" charset="utf-8"></script>
<script src="raphael/g.line-min.js" type="text/javascript" charset="utf-8"></script>
<script src="raphael/g.bar-min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
Ext.setup({
onReady: function()
{
// Set up main panel!
var tabPanel = new Ext.Panel
({
fullscreen: true,
html: '<div id="graph"></div>'
});
// Try to draw a graph!
var r = Raphael('graph');
r.g.txtattr.font = '12px Helvetica, Arial, sans-serif';
r.g.text(150, 250, "Demo chart with title");
r.g.linechart(10, 10, 300, 220, [[1, 2, 3, 4, 5, 6, 7],[3.5, 4.5, 5.5, 6.5, 7, 8]], [[12, 32, 23, 15, 17, 27, 22], [10, 20, 30, 25, 15, 28]], {nostroke: false, axis: "0 0 1 1", symbol: "o", smooth: true});
}
});
</script>
看看http://code.google.com/p/oppo-touching/。有人已將圖表移至Snecha Touch。另外還有消息稱Sencha Touch的下一個版本將包括圖表。
現在有一個官方支持的Sencha Touch圖表包。它在ExtJS變體之上添加了更多的功能(例如觸摸交互)。 – 2011-08-05 01:00:18
他們現在有一些例子。他們應該幫助http://dev.sencha.com/deploy/touch-charts-beta/examples/
下面是煎茶觸摸
var SampleLineChart = new Ext.chart.Chart({
fullscreen : true,
iconCls: 'line',
cls: 'chartpanel',
theme: 'Energy',
interactions: [ 'reset',
{
type: 'panzoom',
axes: {
right: {}
}
},
{
type: 'iteminfo',
gesture: 'tap',
listeners: {
show: function(interaction, item, panel) {
// Ext.dispatch({
// controller : 'Users',
// action : 'popupInfoAbtChart',
// data : {item:item, panel:panel}
// });
}
}
}],
animate: false,
store: EnergyApp.stores.ChartStore, //choose for consumption
axes: [{
type: 'Numeric',
position: 'right',
minimum: 0,
majorTickSteps : 10,
minorTickSteps : 5,
fields: ['generatedpv', 'buildcons','excessPV'],
title: 'Y-axis title'
},
{
type: 'Category',
position: 'bottom',
fields: ['day'],
title: 'X-axis title',
label: {
rotate: {
degrees: 45
}
}
}],
legend: {
position: Ext.is.Phone ? 'left' : 'top'
},
series: [{
type: 'line',
highlight: false,
showMarkers: true,
fill: false,
smooth: true,
axis: 'right',
xField: 'day',
yField: 'generatedpv',
title: 'Field 1
},
{
type: 'line',
highlight: false,
showMarkers: true,
fill: false,
smooth: true,
axis: 'right',
xField: 'day',
yField: 'buildcons',
title: 'Field 2
}],
listeners: {
afterrender: function(me) {
me.on('beforerefresh', function() {
if (me.ownerCt.getActiveItem().id !== me.id) {
return false;
}
}, me);
}
}
});
一個示例圖表守則更多代碼示例走在煎茶 - 觸摸圖表示例文件夾看看EnergyApp例。它被描繪得很好
這裏是一個煎茶論壇鏈接着如何圖表整合到現有的煎茶觸摸2.0應用程序的一些例子:
與圖表API用於煎茶的包存在(http://dev.sencha.com/deploy/touch-charts-beta/examples/),但似乎很難在煎茶觸摸溶液整合(文件依賴關係,功能不是在一些版本的煎茶觸摸包的定義)。
我找到的解決方案是安裝Sencha Architect的試用版,該版本已經包含圖形api,創建一個移動項目(touch項目)並將其打包。然後,我有一個包含正確依賴關係的整個包,我可以在不依賴Sencha Architect的情況下重用它。
- 1. Sencha觸摸圖風格
- 2. Sencha觸摸地圖中心
- 3. phoneGap攝像頭和sencha觸摸視圖
- 4. sencha觸摸列表顯示
- 5. sencha觸摸列表組件
- 6. Sencha觸摸列表分頁
- 7. sencha觸摸搜索表格
- 8. 主題sencha觸摸列表
- 9. Sencha觸摸和餅乾
- 10. Sencha觸摸列表模型和商店
- 11. 開始sencha觸摸
- 12. Sencha觸摸radiofield值
- 13. sencha觸摸協會
- 14. Sencha觸摸圖 - 按字段分組
- 15. 帶sencha觸摸的圖像字段
- 16. Sencha Touch 2觸摸圖像動畫
- 17. sencha觸摸圖工具提示顯示
- 18. Sencha觸摸控制器推視圖
- 19. 谷歌地圖使用sencha觸摸2
- 20. 編寫自定義視圖 - Sencha觸摸
- 21. sencha觸摸按距離排序列表
- 22. Sencha觸摸嵌套列表無數據
- 23. sencha觸摸列表的組模板
- 24. Sencha觸摸列表不顯示數據
- 25. Sencha觸摸+ PhoneGap - 列表不滾動
- 26. Sencha的觸摸列表不刷新
- 27. Sencha觸摸表單面板未顯示
- 28. 樣式sencha觸摸項目列表
- 29. sencha通過JSONP觸摸動態列表
- 30. Sencha觸摸列表不顯示(再次!)
如今Sencha Touch支持圖表。自ST 2.1發佈以來,可以使用它。檢查[此鏈接](http://www.sencha.com/blog/introducing-sencha-touch-2-1-and-more),向下滾動到「Sencha Architect Updated」,您在其中找到關於觸摸圖表的視頻。 – weerd2 2012-11-23 23:43:43
如果您需要開源圖表,可以使用OpenCharts for Sencha Touch:https://github.com/woodenconsulting/OpenCharts-For-Sencha-Touch-and-ExtJS – 2014-03-21 22:45:22