Bar Chart jQuery Graphite - Download Simple Plain Bar Chart Plugin With jQuery - Graphite.js

Download Simple Plain Bar Chart Plugin With jQuery – Graphite.js

Posted on

This time I will share jQuery Plugin and tutorial about Simple Plain Bar Chart Plugin With jQuery – Graphite.js, hope it will help you in programming stack.

Bar Chart jQuery Graphite - Download Simple Plain Bar Chart Plugin With jQuery - Graphite.js
File Size: 6.36 KB
Views Total: 3961
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Graphite.js is a lightweight jQuery plugin to generate a minimal, clean, dynamic, configurable bar/column chart from a data object. With support for x-axis labels and y-axis markers.

How to use it:

1. Download and insert the JavaScript file graphite.js after the latest jQuery library.

2         integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
3         crossorigin="anonymous">
4 </script>
5 <script src="graphite.js"></script>

2. Prepare your data to visualize in the bar/column chart.

1 var myData = {
2     'Java': 55,
3     'Python': 99,
4     'JavaScript': 101,
5     'C#': 80,
6     'Objective-C': 26,
7     'PHP': 55
8 };

3. Create an element to holder the bar/column chart.

1 <div class="graph" id="example"></div>

4. Config the bar/column chart by overring the following settings.

01 var myOptions = {
02  
03     // default: 350
04     'height': 400,
05  
06     // default: ''
07     'title': 'Popular Programming Languages',
08  
09     // width of chart
10     'width': 1000,
11  
12     // background color
13     barColor: 'linear-gradient(rgb(144, 164, 237), rgb(122, 139, 204))'
14  
15     // default: 8
16     'fixPadding': 18,
17  
18     // bar font
19     'barFont': [0, 12, "bold"],
20  
21     // label font
22     'labelFont': [0, 13, 0]
23      
24 };

5. Plot your data to the bar/column chart.

1 graphite(myData, myOptions, example);

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

source : jquery.net