Dynamic Donut Pie Chart Plugin with jQuery D3 js donut pie chart js - Download Dynamic Donut / Pie Chart Plugin with jQuery And D3.js - donut-pie-chart.js

Download Dynamic Donut / Pie Chart Plugin with jQuery And D3.js – donut-pie-chart.js

Posted on

This time I will share jQuery Plugin and tutorial about Dynamic Donut / Pie Chart Plugin with jQuery And D3.js – donut-pie-chart.js, hope it will help you in programming stack.

Dynamic Donut Pie Chart Plugin with jQuery D3 js donut pie chart js - Download Dynamic Donut / Pie Chart Plugin with jQuery And D3.js - donut-pie-chart.js
File Size: 5.84 KB
Views Total: 12363
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

donut-pie-chart.js is a very small jQuery plugin that lets you render dynamic, animated, SVG-based donut / pie charts using d3.js library.

How to use it:

1. Load the necessary jQuery and D3.js JavaScript libraries in the webpage.

1 <script src="/path/to/jquery.min.js"></script>
2 <script src="/path/to/d3.min.js"></script>

2. Download and load the ‘donut-pie-chart.js’ script after jQuery.

1 <script src="donut-pie-chart.min.js"></script>

3. Create a container in which you want to render the donut / pie chart.

1 <div class="exp"></div>

4. Prepare your data you want to present.

1 var data = [
2     {"name" : "JavaScript", "hvalue" : 20 },
3     {"name" : "HTML5", "hvalue" : 2},
4     {"name" : "CSS3", "hvalue" : 25},
5     // assign a color if you'd like to or one would be set for you.
6     {"name" : "Ruby", "hvalue" : 5, "color": "#00ff00" }
7 ];

5. Initialize the plugin.

1 $(".exp").donutpie();

6. Update the chart with custom data.

1 $(".exp").donutpie('update', data);

7. Default options used to customize the plugin.

1 $(".exp").donutpie({
2   radius: 240,
3   tooltip : true,
4   tooltipClass : "donut-pie-tooltip-bubble"
5 });

This awesome jQuery plugin is developed by screename. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net