Self Populating Bar Graph

Developer
Size
2,320 Kb
Views
50,600

How do I make an self populating bar graph?

What is a self populating bar graph? How do you make a self populating bar graph? This script and codes were developed by Tcmulder on 05 August 2022, Friday.

Self Populating Bar Graph Previews

Self Populating Bar Graph - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Self Populating Bar Graph</title> <script src="http://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="stat-group"> <div class="per">10%</div> <div class="per">20%</div> <div class="per">50%</div> <div class="per">50%</div> <div class="per">99%</div> <div class="per">100%</div> <svg class="svg" version="1.1" viewBox="0 0 100 100" xml:space="preserve"></svg>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.1.0/snap.svg-min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Self Populating Bar Graph - Script Codes CSS Codes

body { background: #ececec; width: 100%; height: 100%;
}
.stat-group { position: absolute; left: 1em; top: 1em; bottom: 1em; right: 1em;
}

Self Populating Bar Graph - Script Codes JS Codes

jQuery(function($){ $('.stat-group').each(function(){ var maxHeight = 95; var $this = $(this); var $svg = $this.find('.svg'); var svg = Snap($svg.get(0)); var base = svg .rect(0, maxHeight, 100, 5) .attr({ fill: '#aaa' }); var i = .5; $this.find('.per').each(function(){ var $this = $(this); var per = $this.text().replace("%","") / 100; var bar = svg .rect(15 * i, maxHeight, 10, 0) .attr({ fill: '#199dab', transform: 's1 -1' }) .animate({ y: maxHeight, height: per * maxHeight }, 700, mina.easeinout); i++; $this.remove(); });//$this.find('.per').each });//.stat-group.each
});//jquery
Self Populating Bar Graph - Script Codes
Self Populating Bar Graph - Script Codes
Home Page Home
Developer Tcmulder
Username tcmulder
Uploaded August 05, 2022
Rating 3
Size 2,320 Kb
Views 50,600
Do you need developer help for Self Populating Bar Graph?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Tcmulder (tcmulder) Script Codes
Create amazing love letters with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!