我是JavaScript的图形编程新手,我正在尝试拉斐尔图书馆。我试图显示一个简单的圆圈,但只获得一个空白页面。这是源代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title> Raphael JS Test </title>
<script src="raphael.js"></script>
<script>
window.onload = function() {
var p = Raphael(10, 10, 400, 400);
p.circle(100, 100, 45);
}
</script>
</head>
<body>
</body>
</html>
非常感谢所有帮助!谢谢!
答案 0 :(得分:1)
我认为圆圈出现在页面上,但它是白色的,白色背景上有白色笔划。您是否尝试设置颜色
// Sets the fill attribute of the circle to red (#f00)
circle.attr("fill", "#f00");
或
// Sets the stroke attribute of the circle to white
circle.attr("stroke", "#fff");