在SenchaTouch中使用图表

Cri*_*ris 0 charts sencha-touch

我开始使用SenchaTouch,我喜欢它; 我真的希望能够在SenchaTouch应用程序中显示交互式图表(例如向下钻取:当用户点击图表栏,捕获事件并显示另一个图表时),是否有人试图这样做?

在此先感谢c.

小智 5

正如您已经确定的那样,Sencha Touch是面向移动设备的,因此如果您在iPhone/iPad移动应用程序中使用Flash,它就无法运行.所以,我真的建议你使用Raphaëljavascript图表.Sencha Team已经将它用于新的Ext 4版本,我很有用它甚至可以在下一个Sencha Touch版本中正式使用.

我给你发了一个简单的例子,向你展示如何在Panel主体内初始化Raphael图表:

var myPanel = new Ext.Panel({
fullscreen: true,
html: 'The tabs above are also sortable.<br />(tap and hold)<br/>' +
    '<div id="raphaelChart"></div>',
listeners: {
    afterrender: function(){
        //Let's create the Raphael chart
        var set = Raphael(['raphaelChart', 320, 200, {
            type: "rect",
            x: 10,
            y: 10,
            width: 25,
            height: 25,
            stroke: "#f00"
        },{
            type: "text",
            x: 70,
            y: 50,
            text: "This is a Raphael Example"
        }]);
    }
}
Run Code Online (Sandbox Code Playgroud)

});

希望这可以帮助.