質問

I am new to graphics programming in JavaScript and am trying the Raphael Library. I am trying to display a simple circle but getting only a blank page. Here is the source code:

  <!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>

All help is greatly appreciated! Thanks!

役に立ちましたか?

解決

I think that the circle is present on the page, but it is white, with white stroke on white background. Have you try to set a color

// Sets the fill attribute of the circle to red (#f00)
circle.attr("fill", "#f00");

or

// Sets the stroke attribute of the circle to white
circle.attr("stroke", "#fff");
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top