我试着用一段时间将图形渲染到我的sencha touch 2应用程序中,但是我无法做到这一点,现在的sencha图表与ST2不兼容。所以我搜索并存在许多APIS来制作图表,现在问题是将这个apis整合到sencha touch中。
我看到google chart api非常简单,但我怎么能显示它?我需要像html的视图。
有一个简单的代码:https://google-developers.appspot.com/chart/interactive/docs/quick_start
我如何将这些代码显示在此:
this.getHistorial().push({ // Is a new view in a Ext.navigation.View
xtype: 'panel',
title: record.get('title'),
layout: 'fit',
htmlContent: true,
items: [
{
html:[
//Show chart (Google API)
].join('')
}
]
});
也许如果我能把它变成html:[]显示一个小文件html(就像一个网站),只是渲染我的应用程序。我怎么能这样做?
答案 0 :(得分:0)
查看此讨论:http://www.sencha.com/forum/showthread.php?139473-Google-Charts-on-Sencha-Touch
它发生在ST2之前,但对于这个新版本效果很好。
要点是: - 在index.html中加载google api脚本 - 创建一个面板 - 将面板传递给图表api。记住,面板只是一个支撑的div
答案 1 :(得分:0)
您可以将OpenCharts用于Sencha Touch 2.x或ExtJS 4.x
GitHub仓库中有两个示例应用程序,并且已有详细记录。
https://github.com/woodenconsulting/OpenCharts-For-Sencha-Touch-and-ExtJS