图表不会绘制与extjs 3.4 [英] charts won't draw with extjs 3.4

查看:116
本文介绍了图表不会绘制与extjs 3.4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个简单的问题,真的很简单的代码,我只是复制/粘贴代码示例,在我的本地项目当然,但没有图表绘图...我真的不明白发生了什么,我改变疑问url的swf在我的本地文件夹,同样的问题,请帮助!

A simple problem, really simple code, i just copy/paste the code example, on my local project of course, but no charts drawing ... i really don't understand what's happening, i change in doubt url of the swf on my local folder, same problem, please help !

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Charts v1.0</title>
    <link rel="stylesheet" type="text/css" href="css/ext-all.css" rel="stylesheet" />
    <script type="text/javascript" src="js/ext-base-debug.js"></script>
    <script type="text/javascript" src="js/ext-all-debug.js"></script>
    <style>

    </style>
</head>
<script type="text/javascript">

    Ext.onReady(function(){

         // extra extra simple
        Ext.chart.Chart.CHART_URL = 'images/charts.swf';

         var store = new Ext.data.JsonStore({
            fields:['name', 'visits', 'views'],
        data: [
            {name:'Jul 07', visits: 245000, views: 3000000},
            {name:'Aug 07', visits: 240000, views: 3500000},
            {name:'Sep 07', visits: 355000, views: 4000000},
            {name:'Oct 07', visits: 375000, views: 4200000},
            {name:'Nov 07', visits: 490000, views: 4500000},
            {name:'Dec 07', visits: 495000, views: 5800000},
            {name:'Jan 08', visits: 520000, views: 6000000},
            {name:'Feb 08', visits: 620000, views: 7500000}
        ]
        });

// extra extra simple
new Ext.Panel({
    title: 'ExtJS.com Visits Trend, 2007/2008 (No styling)',
    renderTo: 'container',
    width:500,
    height:300,
    layout:'fit',
    items: {
        xtype: 'linechart',
        store: store,
        xField: 'name',
        yField: 'visits',
        listeners: {
            itemclick: function(o){
                var rec = store.getAt(o.index);
                Ext.example.msg('Item Selected', 'You chose {0}.', rec.get('name'));
            }
        }
    }
});
});

</script>
<body style="padding: 50px;"><div id='container'></div></body>
 </html>

没有网络问题,所有需要的ressources正确加载..也尝试没有def的url,在这种情况下,extjs得到yahooui cdn上的swf,同样的问题

No network problem, all needed ressources are correctly loaded .. also tried with no def of the url, in this case extjs get the swf on yahooui cdn, same problem

推荐答案

你不能在本地运行没有web服务器,这就是为什么失败。设置一个本地网络服务器,它应该工作。

you cannot run it locally without a webserver, that's why it fails. Setup up a local webserver an it should work.

这篇关于图表不会绘制与extjs 3.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆