Login / Join
Example using jQuery Flot Animator
submitted on 12/10/2013 by
Codicode
+ infos
Config
Embed
Share
Example using jQuery Flot Animator
by
Codicode
Animating flot charts with jQuery Flot Animator
Framework 1 :
-- None --
jQuery 2.0.3
jQuery 1.9.1
jQuery 1.9.0
jQuery 1.8.0
jQuery 1.7.1
jQuery 1.6.3
jQuery UI 1.10.3
MooTools 1.4.5
AngularJS 1.0.4
Prototype 1.7.1.0
Dojo 1.8.3
Chrome Frame 1.0.3
Ext Core 3.1.0
SWFObject 2.2
WebFont Loader 1.1.2
Framework 2 :
-- None --
jQuery 2.0.3
jQuery 1.9.1
jQuery 1.9.0
jQuery 1.8.0
jQuery 1.7.1
jQuery 1.6.3
jQuery UI 1.10.3
MooTools 1.4.5
AngularJS 1.0.4
Prototype 1.7.1.0
Dojo 1.8.3
Chrome Frame 1.0.3
Ext Core 3.1.0
SWFObject 2.2
WebFont Loader 1.1.2
+ Js file(s) :
//www.flotcharts.org/javascript/jquery.flot.min.js //www.codicode.com/demo/flotanimator/jquery.flot.animator.min.js
+ Css file(s) :
Apply
Link :
Direct http link :
Fork button :
Html code :
Embed preview :
Copy the following html code to your page to embed the preview,
To include many previews on a single page, just repeat the first line.
You can change the width, height and border color (bcolor).
<div class="refork-widget" code="4a3" style="width:100%;height:200px;" bcolor="#ccc"></div>
<script type="text/javascript" src="//snippet.run/d/z.js"></script>
HTML
<div style="padding:18px"> <b>Animator for jQuery Flot :</b><br> More infos: <a href="http://www.codicode.com/art/jquery_flot_animator.aspx" target="_blank">http://www.codicode.com/art/jquery_flot_animator.aspx</a></div> <div id="chart1" style="width:500px;height:250px;padding:5px;"></div> <div id="dv"> <button id="bnt1" type="button">reAnimate</button> <span id="txt"></span> </div>
CSS
body { background-color:#fff; } #dv { position:relative; top:-230px; left:30px; color:red; font-weight:bold; }
Javascript
$(function(){ var d8 = [[2, 2],[4, 5],[6, 8],[7, 4],[9,7],[10, 10],[12, 8],[13, 7],[14, 9]]; var d9 = [[2, 1.5],[2.5, 2],[4.5, 4],[6.5, 8],[7.5, 4],[9.5,7],[10.5, 10],[12.5, 8],[13.5, 7],[14.5, 9],[15, 10]]; var plot = $.plotAnimator($("#chart1"), [{data : d8, bars: { show: true, fill: true}},{data : d9, lines: {lineWidth:6}, animator: {start:100, steps:99, duration:1000, direction: "right"}}],{grid: { backgroundColor: { colors: [ "#fff", "#eee" ] }}}); $("#bnt1").attr("disabled", "disabled"); $("#chart1").on("animatorComplete", function() { $("#bnt1").removeAttr("disabled"); $("#txt").html('Animation complete.'); }); $("#bnt1").on("click",function() { $("#bnt1").attr("disabled", "disabled"); $("#txt").html('Animating ...'); plot = $.plotAnimator($("#chart1"), [{data : d8, bars: { show: true, fill: true}},{data : d9, lines: {lineWidth:6}, animator: {start:0, steps:121, duration:1500, direction: "right"}}],{grid: { backgroundColor: { colors: [ "#fff", "#eee" ] }}}); }); });
©2013 Copyright snippet.run
Privacy
-
Terms of use
-
About
-
Contact