/timepiece/static/jqplot/plugins/jqplot.ciParser.min.js
https://bitbucket.org/copelco/django-timepiece/ · JavaScript · 30 lines · 1 code · 0 blank · 29 comment · 0 complexity · 055e3265a1ab399b7a260a2dfbcf5475 MD5 · raw file
- /**
- * jqPlot
- * Pure JavaScript plotting plugin using jQuery
- *
- * Version: 1.0.0a_r701
- *
- * Copyright (c) 2009-2011 Chris Leonello
- * jqPlot is currently available for use in all personal or commercial projects
- * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
- * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
- * choose the license that best suits your project and use it accordingly.
- *
- * Although not required, the author would appreciate an email letting him
- * know of any substantial use of jqPlot. You can reach the author at:
- * chris at jqplot dot com or see http://www.jqplot.com/info.php .
- *
- * If you are feeling kind and generous, consider supporting the project by
- * making a donation at: http://www.jqplot.com/donate.php .
- *
- * sprintf functions contained in jqplot.sprintf.js by Ash Searle:
- *
- * version 2007.04.27
- * author Ash Searle
- * http://hexmen.com/blog/2007/03/printf-sprintf/
- * http://hexmen.com/js/sprintf.js
- * The author (Ash Searle) has placed this code in the public domain:
- * "This code is unrestricted: you are free to use it however you like."
- *
- */
- (function(a){a.jqplot.ciParser=function(g,l){var m=[],n,h,f,e,c;if(typeof(g)=="string"){g=a.jqplot.JSON.parse(g,d)}else{if(typeof(g)=="object"){for(e in g){for(h=0;h<g[e].length;h++){for(c in g[e][h]){g[e][h][c]=d(c,g[e][h][c])}}}}else{return null}}function d(j,k){var i;if(k!=null){if(k.toString().indexOf("Date")>=0){i=/^\/Date\((-?[0-9]+)\)\/$/.exec(k);if(i){return parseInt(i[1],10)}}return k}}for(var b in g){n=[];temp=g[b];switch(b){case"PriceTicks":for(h=0;h<temp.length;h++){n.push([temp[h]["TickDate"],temp[h]["Price"]])}break;case"PriceBars":for(h=0;h<temp.length;h++){n.push([temp[h]["BarDate"],temp[h]["Open"],temp[h]["High"],temp[h]["Low"],temp[h]["Close"]])}break}m.push(n)}return m}})(jQuery);