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

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