Skip to content

Creates a responsive horizontal bar chart using HTML5, jQuery & CSS

License

Notifications You must be signed in to change notification settings

sivajisanapala/horizontal-chart

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Horizontal Responsive Bar Chart

Creates a responsive horizontal bar chart using HTML5, jQuery & CSS

Even works in IE6!!

The plugin uses the data-number attribute for the graph length.

jQuery will then cycle through all the selector's and find the one with the highest number. That number will be used as 100% base point and make the rest of the bars relative to that number.

Use

Required files

Include jQuery and required files

<script src="build/js/jquery.min.js"></script>
<script src="build/js/jquery.horizBarChart.min.js"></script>

Markup:

The plugin uses the data-number attribute for the graph length.
jQuery will then cycle through all the selector's and find the one with the highest number.
That number will be used as 100% base point and make the rest of the bars relative to that number.

<ul class="chart">
	<li><span class="bar" data-number="38000"></span><span class="number">38,000</span></li>
	<li><span class="bar" data-number="134000"></span><span class="number">134,000</span></li>
</ul>

Code:

Simplest way to use is create the following markup and just call .horizBarChart() on your containing element.

$('.chart').horizBarChart();

Options & Defaults

The following are the available options and default values.

$('.chart').horizBarChart({
  selector: '.bar',
  speed: 3000
});

Example

View an example on GitHub pages : http://eriku.github.io/horizontal-chart

About

Creates a responsive horizontal bar chart using HTML5, jQuery & CSS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 39.0%
  • HTML 33.7%
  • JavaScript 23.0%
  • Ruby 4.3%