美文网首页
svg (Scalable Vector Graphics)

svg (Scalable Vector Graphics)

作者: z_j_r | 来源:发表于2017-12-21 21:21 被阅读0次

    前言:

    幸运之神的降临,往往只是因为你多看了一眼,多想了一下,多走了一步

    --------------------------------正文---------------------------------

    line(线)

      svg{
         width:800px;
         height:600px;
         background:#fff;
      }
      line{
         stroke:#000;
         stroke-width:10;
      }       
      <svg>
         <line x1="100" y1="100" x2="300" y2="300"/>
      </svg>
    

    rect(矩形)

      rect{
        x:100;
        y:100;
        width:200px;
        height:150px;
        fill:#f00;
        stroke:#000;
        stroke-width:10;
        fill-opacity:0.5;
        rx:20;
        ry:20;
      }
      <rect />
    

    circle(圆形)

      circle{
        cx:300;
        cy:200;
        r:100;
        fill:#f00;
        stroke:#000;
        stroke-width:10;
        fill-opacity:0.5;
      }
      <circe />
    

    ellipse(椭圆)

      ellipse{
        cx:300;
        cy:200;
        rx:200;
        ry:100;
        fill:none;
        stroke:#000;
      }
      <ellipse />
    

    polygon(多边形)

      <polygon points="400,100 500,400 250,200 550,200 300,400" fill="#f90" stroke="#000"></polygon>
    

    polyline(折线)

      <polyline points="100,100 200,100 250,120 200,150"></polyline>
    

    path(路径)

      <path d="M100,100 L200,100 L200,300 Z" />
      <path d="M100,100 Q150,0 200,100 T250,100" />
      <path d="M100,100 C150,20 250,50 300,100 S350,200 400,100 Z" />
            M       moveto
            L       lineto
            H       水平to
            V       垂直to
            C       三次贝塞尔曲线
            S       继续画三次贝塞尔曲线
            Q       二次贝塞尔曲线
            T       继续画二次贝塞尔曲线
            A       弧
            Z       闭合
    

      国产
        echarts         百度
      进口
        Raphaël
        threejs
        highcharts
        charts
        d3
        openlayers
    

    中国地图

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Document</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            body{
                background: #000;
                text-align: center;
            }
            svg{
                width: 1000px;
                height: 600px;
                background: #fff;
            }
            path{
                stroke: #000;
                fill: red;
    
            }
        </style>
    </head>
    <body>
        <svg>
            <path d="M784.63,410.41l-2.42,1.41l-2.3,-0.91l-0.08,-2.53l1.38,-1.34l3.06,-0.83l1.61,0.07l0.63,1.13l-1.23,1.3L784.63,410.41zM833.19,302.89l4.88,1.38l3.32,3.03l1.13,3.95l4.26,0l2.43,-1.65l4.63,-1.24l-1.47,3.76l-1.09,1.51l-0.96,4.46l-1.89,3.89l-3.4,-0.7l-2.41,1.4l0.74,3.36l-0.4,4.55l-1.43,0.1l0.02,1.93l-1.81,-2.24l-1.11,2.13l-4.33,1.62l0.44,1.97l-2.42,-0.14l-1.33,-1.17l-1.93,2.64l-3.09,1.98l-2.28,2.35l-3.92,1.06l-2.06,1.69l-3.02,0.98l1.49,-1.67l-0.59,-1.41l2.22,-2.45l-1.48,-1.93l-2.44,1.3l-3.17,2.54l-1.73,2.34l-2.75,0.17l-1.43,1.68l1.48,2.41l2.29,0.58l0.09,1.58l2.22,1.02l3.14,-2.51l2.49,1.37l1.81,0.09l0.46,1.84l-3.97,0.97l-1.31,1.87l-2.73,1.73l-1.44,2.39l3.02,1.86l1.1,3.31l1.71,3.05l1.9,2.53l-0.05,2.43l-1.76,0.89l0.67,1.73l1.65,1l-0.43,2.61l-0.71,2.52l-1.57,0.28l-2.05,3.41l-2.27,4.09l-2.6,3.68l-3.86,2.82l-3.9,2.55l-3.16,0.35l-1.71,1.34l-0.97,-0.98l-1.59,1.5l-3.92,1.5l-2.97,0.46l-0.96,3.15l-1.55,0.17l-0.74,-2.16l0.66,-1.16l-3.76,-0.96l-1.33,0.49l-2.82,-0.78l-1.33,-1.22l0.44,-1.74l-2.56,-0.55l-1.35,-1.14l-2.39,1.62l-2.73,0.35l-2.24,-0.02l-1.5,0.74l-1.45,0.44l0.42,3.43l-1.5,-0.08l-0.25,-0.7l-0.08,-1.24l-2.06,0.87l-1.21,-0.55l-2.08,-1.13l0.82,-2.51l-1.78,-0.59l-0.67,-2.8l-2.96,0.51l0.34,-3.63l2.66,-2.58l0.11,-2.57l-0.08,-2.4l-1.22,-0.75l-0.94,-1.86l-1.64,0.24l-3.02,-0.47l0.95,-1.33l-1.31,-1.99l-2,1.35L740.4,378l-3.23,2.03l-2.55,2.36l-2.26,0.39l-1.23,-0.85l-1.48,-0.08l-2,-0.73l-1.51,0.8l-1.85,2.34l-0.24,-2.48l-1.71,0.66l-3.27,-0.31l-3.17,-0.73l-2.28,-1.39l-2.18,-0.63l-0.94,-1.53l-1.58,-0.46l-2.83,-2.09l-2.25,-0.99l-1.16,0.77l-3.9,-2.26l-2.75,-2.07l-0.79,-3.63l2.01,0.44l0.09,-1.69l-1.12,-1.71l0.28,-2.74l-3.01,-3.99l-4.61,-1.39l-0.83,-2.66l-2.07,-1.63l-0.5,-1.01l-0.42,-2.01l0.1,-1.38l-1.7,-0.81l-0.92,0.36l-0.71,-3.32l0.8,-0.83l-0.39,-0.85l2.68,-1.73l1.94,-0.72l2.97,0.49l1.06,-2.35l3.6,-0.44l1,-1.48l4.42,-2.03l0.39,-0.85l-0.22,-2.17l1.92,-1l-2.52,-6.75l5.55,-1.58l1.44,-0.89l2.02,-7.26l5.56,1.35l1.56,-1.86l0.13,-4.19l2.33,-0.39l2.13,-2.83l1.1,-0.35l0.74,2.97l2.36,2.23l4,1.57l1.93,3.32l-1.08,4.73l1.01,1.73l3.33,0.68l3.78,0.55l3.39,2.45l1.73,0.43l1.28,3.57l1.65,2.27l3.09,-0.09l5.79,0.85l3.73,-0.53l2.77,0.57l4.15,2.29l3.39,0l1.24,1.16l3.26,-2.01l4.53,-1.31l4.2,-0.14l3.28,-1.34l2.01,-2.05l1.96,-1.3l-0.45,-1.28l-0.9,-1.5l1.47,-2.54l1.58,0.36l2.88,0.8l2.79,-2.1l4.28,-1.55l2.05,-2.66l1.97,-1.16l4.07,-0.54l2.21,0.46l0.31,-1.45l-2.54,-2.89l-2.25,-1.33l-2.16,1.54l-2.77,-0.65l-1.59,0.53l-0.72,-1.71l1.98,-4.23l1.37,-3.25l3.37,1.63l3.95,-2.74l-0.03,-1.93l2.53,-4.73l1.56,-1.45l-0.04,-2.52l-1.54,-1.1l2.32,-2.31l3.48,-0.84l3.72,-0.13l4.2,1.39l2.46,1.71l1.73,4.61l1.05,1.94l0.98,2.73L833.19,302.89z" />    
            <path d="M816.7,393.27L815.01,398.14L813.81,400.62L812.33,398.07L812.01,395.82L813.66,392.82L815.91,390.5L817.19,391.41z" />
        </svg>
    </body>
    </html>
    

    相关文章

      网友评论

          本文标题:svg (Scalable Vector Graphics)

          本文链接:https://www.haomeiwen.com/subject/phdzwxtx.html