You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Plugins/dataRender/percentageBars.min.js

2 lines
1.2 KiB
JavaScript

/*! © Drijkoningen Dirk - datatables.net/license */
!function(n){"function"==typeof define&&define.amd?define(["datatables.net"],function(e){return n(e,window,document)}):"object"==typeof exports?module.exports=function(e,t){return e=e||window,t.fn.dataTable||require("datatables.net")(e,t),n(t,0,e.document)}:n(jQuery,window,document)}(function(e,t,n,i){"use strict";e=e.fn.dataTable;return e.render.percentBar=function(e,t,n,i,r,o,d){o=o||0;var a="border:2px "+(d=d||"ridge")+" "+(n=n||"#BCBCBC")+";line-height:12px;font-size:14px;color:"+(t=t||"#000")+";background:"+(r=r||"#E6E6E6")+";position:relative;",u="height:12px;line-height:12px;text-align:center;background-color:"+(i=i||"#5FD868")+";padding:auto 6px;";return"round"==(e=e||"square")&&(a+="border-radius:5px;",u+="border-top-left-radius:4px;border-bottom-left-radius:4px;"),function(e,t,n){var i=parseFloat(e.toString().replace(/\s%|%/g,"")).toFixed(o);return 100<i&&(i=100),"display"!==t?i:"number"!=typeof e&&"string"!=typeof e?e:'<div style="max-width:100px;height:12px;margin:0 auto;"><div style="'+a+'"><div style="'+u+"width:"+i+'%;"></div><div style="width:100%;text-align:center;position:absolute;left:0;top:0;">'+i+"%</div></div></div>"}},e});