D3.js is a JavaScript library for manipulating documents based on data.
D3 helps you bring data to life using HTML, SVG and CSS.
Basically Using D3.Js we can easily visualize the data's.
There are many library for viualize the data as graphs.But the beauty of d3.js is SVG (Scalable Vector Graphics) based.We can easily create and show any type of visualizing not only like line chart,bubble chart,area chart etc.Also,We can create based on our choice.
SVG
What is SVG mean?
SVG stands for Scalable Vector Graphics. SVG is used to define vector-based graphics for the Web SVG defines the graphics in XML format SVG graphics do NOT lose any quality if they are zoomed or resized
Every element and every attribute in SVG files can be animated
This is the Basic introduction about D3.js.I hope you all now know what is d3.js.In future article i will tell you how to start write coding using D3.Js
In this article using SVG (Scalable Vector Graphics) we can create the bar chart.Last three articles we are seeing about the bar chart creation in different ways.
So in this article also we are going to see for creating bar chart using svg
Comparing div and svg
SVG would be easier for you, since selection and moving it around is already built in. SVG objects are DOM objects, so they have "click" handlers, etc.
DIVs are okay but clunky and have awful performance loading at large numbers.
Also see some of the similarities between svg and html
You can write SVG markup and embed it directly in a web page (provided you use <!DOCTYPE html>). You can inspect SVG elements in your browser’s developer tools. And SVG elements can be styled with CSS, albeit using different property names like fill instead of background-color. However, unlike HTML, SVG elements must be positioned relative to the top-left corner of the container; SVG does not support flow layout or even text wrapping.
Now we will see the same example which we seen in last article.But in program is created using svg
But unlike the div elements that were implicitly positioned using flow layout, the SVG elements must be absolutely positioned with hard-coded translations relative to the origin.
Normally svg doesn't support all styles which are all supported by html.So take a look for understanding about the svg styles by using the below link.