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.3 KiB
JavaScript

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