D3附加问题。这段代码有什么问题?

时间:2015-01-29 16:24:02

标签: d3.js append

<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="utf-8">
        <title>Curve</title>
        <script src='http://d3js.org/d3.v2.min.js'></script>
        <style type="text/css">
            /* No style rules here yet */       
        </style>
    </head>

    <body>
      <script>
        var svg = d3.select("body").append("svg")
        .attr("width",500).attr("height",500);

        // this area is giving problem
        svg.append("path").attr("d",M 82 85 C 85 95 115 95 118 85).attr(fill","black");

      </script>
    </body>
</html>

1 个答案:

答案 0 :(得分:0)

svg.append("path").attr("d",M 82 85 C 85 95 115 95 118 85).attr(fill","black");

需要

svg.append("path").attr("d","M 82 85 C 85 95 115 95 118 85").attr("fill","black");