拉斐尔饼图错误?
我尝试使用 graphael 网站中的相同代码在我的网站中添加 grahael 饼图
gRaphaël 静态饼图
<script src="http://raphaeljs.com/raphael.js" type="text/javascript" charset="utf-8"></script>
<script src="g.raphael.js" type="text/javascript" charset="utf-8"></script>
<script src="g.pie.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
window.onload = function () {
var r = Raphael("holder");
r.g.txtattr.font = "12px 'Fontin Sans', Fontin-Sans, sans-serif";
r.g.text(320, 70, "Static Pie Chart").attr({"font-size": 20});
r.g.piechart(320, 240, 150, [55, 20, 13, 32, 5, 1, 2, 10]);
};
</script>
</head>
<body class="raphael" id="g.raphael.dmitry.baranovskiy.com">
<div id="holder"></div>
<p>
Demo of <a href="http://g.raphaeljs.com/">gRaphaël</a> JavaScript library.
</p>
</body>
但我没有得到图表,并且在 firebug 上我收到像 Raphael not Defined 这样的错误?
i try to add grahael pie chart in my web site using same code from graphael site
gRaphaël Static Pie Chart
<script src="http://raphaeljs.com/raphael.js" type="text/javascript" charset="utf-8"></script>
<script src="g.raphael.js" type="text/javascript" charset="utf-8"></script>
<script src="g.pie.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
window.onload = function () {
var r = Raphael("holder");
r.g.txtattr.font = "12px 'Fontin Sans', Fontin-Sans, sans-serif";
r.g.text(320, 70, "Static Pie Chart").attr({"font-size": 20});
r.g.piechart(320, 240, 150, [55, 20, 13, 32, 5, 1, 2, 10]);
};
</script>
</head>
<body class="raphael" id="g.raphael.dmitry.baranovskiy.com">
<div id="holder"></div>
<p>
Demo of <a href="http://g.raphaeljs.com/">gRaphaël</a> JavaScript library.
</p>
</body>
But im not getting the chart and on firebug im getting error like Raphael not defined ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在从远程站点加载一个脚本,并在本地加载其他脚本。您确定您的 html 文件所在的文件夹中确实有
g.raphael.js
和g.pie.js
吗?You are loading one script from a remote site and the others locally. Are you sure you actually have
g.raphael.js
andg.pie.js
in the same folder as your html file?