SVG

SVG Introduction

SVG stands for Scaleable Vector Graphics. It is a graphics standard maintained by World Wide Web Consortium(W3C). SVG allows a user to create two-dimensional Vector Images, which consists of mathematical representation of objects and can be scaled infinitely without any loss in Quality. SVG is useful for vector type diagrams like Piecharts, Two-dimensional graphs in an X,Y coordinate system …

SVG Introduction Read More »

Advantages of SVG

Advantages of SVG There are number of advantages of SVG in HTML5:- Open-Source (XML):- it is based on XML(endorsed by W3C) and source code can be viewed by all. Client-Side: – SVG is a client-side graphics, hence has a very light load on the webserver. As well as SVG is dynamic and interactive. Familiarity: – SVG uses XML, CSS, JavaScript, …

Advantages of SVG Read More »

SVG include some tags within HTML5 document

SVG include some tags within HTML5 document HTML5 allows user to add SVG graphics directly into the webpage. The root element <svg> sets the width and height of the finished graphics in pixels. The element <title> provides title to the document and is displayed on top of browser tab. The element <desc> provides complete description about the image

SVG Elements

SVG Elements <line> element <rect> element <circle> element <ellipse> element <polygon> element <text> element <path> element <pattern> element <lineargradient> element <radialgradient> element <filter> element

SVG LINE: ‹ line › element

The svg <line> element is used to draw line. Where the (X1, X2) Coordinates specifies the starting point and (X3, X4) Coordinates specifies the end point of line. Here is a simple example of SVG Line element.   Code Output      

SVG Circle: < circle > element

The SVG <circle> element is used to draw circles. The attributes (cx, cy) represents the coordinates of the center, while attribute “r” represents the radius of the circle. Here is a simple example of SVG Rectangle element.  Code Output    

SVG Ellipse: < ellipse > element

The SVG <ellipse> element is used to draw ellipse. The attributes (cx, cy) represents the co-ordinates of centre, while attribute “rx” and “ry” represents the radius along X axis and Y axis respectively. Here is a simple example of SVG ellipse element.  Code  Output    

SVG Polygon: < polygon > element

The SVG <polygon> element is used to draw a polygon of various sizes. The attributes (x, y) represents the coordinates of each vertex of the polygon and each co-ordinate(X, Y) are separated by a white space. Here is a simple example of SVG polygon element.  Code Output    

SVG Text: < text > element

The SVG <text> element is used to display text, in Vectors. The attributes (x, y) represents the starting coordinates of the text. Here is a simple example of SVG Text element.   Code            Output    

SVG Linear Gradient: < lineargradient > element

SVG Linear Gradient: < lineargradient > element The SVG <lineargradient> element is used to represents the linear gradient to be used as fill .The attributes (x1, y1) and (x2, y2) represents the start and end points of the gradient. The attributes offset andstopcolor represents the color at each offset point. Here is a simple example of SVG Linear Gradient element. Code Fig17   Output   Fig18

SVG Radial Gradient: < radialgradient > element

 SVG Radial Gradient: < radialgradient > element The SVG <radialgradient> element represent the radial color gradient, which can be used as a fill. The Radial Gradients consists two circles over which color patterns are created :Start Circle and End Circle. The attributes (cx, cy) and “r” represents the End Circle and (fx, fy) represents the Start Circle. Here is a simple example of SVG radialgradient element. Code   Fig19 …

SVG Radial Gradient: < radialgradient > element Read More »

Scroll to Top