Animated bar chart
How do I make an animated bar chart?
Simple animated bar chart. This could be made purely in CSS once there is support for using attr() with the "height" property. This is proposed and should work in the future, though.. What is a animated bar chart? How do you make a animated bar chart? This script and codes were developed by Creative Punch on 09 December 2022, Friday.
Animated bar chart - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Animated bar chart</title> <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 id="chart"> <ul id="numbers"> <li><span>100%</span></li> <li><span>90%</span></li> <li><span>80%</span></li> <li><span>70%</span></li> <li><span>60%</span></li> <li><span>50%</span></li> <li><span>40%</span></li> <li><span>30%</span></li> <li><span>20%</span></li> <li><span>10%</span></li> <li><span>0%</span></li> </ul> <ul id="bars"> <li><div data-percentage="56" class="bar"></div><span>Option 1</span></li> <li><div data-percentage="33" class="bar"></div><span>Option 2</span></li> <li><div data-percentage="54" class="bar"></div><span>Option 3</span></li> <li><div data-percentage="94" class="bar"></div><span>Option 4</span></li> <li><div data-percentage="44" class="bar"></div><span>Option 5</span></li> <li><div data-percentage="23" class="bar"></div><span>Option 6</span> </li> </ul>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Animated bar chart - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Roboto:400+700);
body { background: #30303A; font-family: Roboto;
}
#chart { width: 650px; height: 300px; margin: 30px auto 0; display: block;
}
#chart #numbers { width: 50px; height: 100%; margin: 0; padding: 0; display: inline-block; float: left;
}
#chart #numbers li { text-align: right; padding-right: 1em; list-style: none; height: 29px; border-bottom: 1px solid #444; position: relative; bottom: 30px;
}
#chart #numbers li:last-child { height: 30px;
}
#chart #numbers li span { color: #eee; position: absolute; bottom: 0; right: 10px;
}
#chart #bars { display: inline-block; background: rgba(0, 0, 0, 0.2); width: 600px; height: 300px; padding: 0; margin: 0; box-shadow: 0 0 0 1px #444;
}
#chart #bars li { display: table-cell; width: 100px; height: 300px; margin: 0; text-align: center; position: relative;
}
#chart #bars li .bar { display: block; width: 70px; margin-left: 15px; background: #49E; position: absolute; bottom: 0;
}
#chart #bars li .bar:hover { background: #5AE; cursor: pointer;
}
#chart #bars li .bar:hover:before { color: white; content: attr(data-percentage) '%'; position: relative; bottom: 20px;
}
#chart #bars li span { color: #eee; width: 100%; position: absolute; bottom: -2em; left: 0; text-align: center;
}
Animated bar chart - Script Codes JS Codes
$(function() { $("#bars li .bar").each( function( key, bar ) { var percentage = $(this).data('percentage'); $(this).animate({ 'height' : percentage + '%' }, 1000); });
});
Developer | Creative Punch |
Username | CreativePunch |
Uploaded | December 09, 2022 |
Rating | 4.5 |
Size | 3,124 Kb |
Views | 12,144 |
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!
Name | Size |
Textured text | 1,947 Kb |
SVG blurred header | 3,102 Kb |
Gradient text with CSS3 | 2,032 Kb |
Retro text with hover | 1,578 Kb |
Glowing lights loader animation with pure CSS | 2,785 Kb |
CSS3 animated sliding box without javascript. | 2,554 Kb |
Sass colorful shadows experiment | 2,886 Kb |
Colorful glass menu concept | 3,022 Kb |
Long shadow social icons with Sass | 4,129 Kb |
3D jQuery rotator | 3,238 Kb |
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!
Name | Username | Size |
Project -Show the Local Weather | Luciano_Britis | 2,583 Kb |
Rows with image hover effect | Amit-webdesigner | 12,875 Kb |
Banner Ad | Raquellorenzana | 4,172 Kb |
Brian The CSS Bee | Jonitrythall | 3,922 Kb |
APortfolio | Skybutterfly | 5,174 Kb |
AngularJS Skills | Supro | 3,312 Kb |
Ghost Buttons with CSS3 | Mithicher | 2,509 Kb |
Tail rose iris lined | Kbrtrm | 1,846 Kb |
A Pen by Final Boss tommyb9 | FBtommyb9 | 55,354 Kb |
A Pen by Michael Parenteau | Michaelparenteau | 2,133 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!