butterfly-halo-theme
Version:
一个Halo博客主题,Butterfly
1 lines • 2.08 kB
JavaScript
(()=>{"use strict";function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var t=function(){function t(){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function");this.drawChart()}for(var e,r=t,o=[{key:"drawChart",value:function(){var t,n;window.drawEchartsDom=document.querySelector(".categories .categories-chart"),drawEchartsDom&&(t=$(".categories-list li"),n=[],t.each(function(t,e){var r=$(this),o=r.attr("data-displayName"),r=parseFloat(r.attr("data-postCount")||0);n.push({value:r,name:o})}),n=n.sort(function(t,e){return t.postCount-e.postCount}),window.drawEchartsOption={backgroundColor:"",title:{text:"文章分类统计图📇",x:"center"},tooltip:{formatter:"{a} <br/>{b} : {c} ({d}%)"},grid:{containLabel:!0,bottom:"0%",left:"5%",right:"5%"},legend:{icon:"circle",y:"95%",bottom:"center"},series:[{name:"分类统计",type:"pie",radius:[40,150],center:["50%","48%"],roseType:"area",itemStyle:{borderRadius:8},label:{formatter:"{b} : {c} ({d}%)"},data:n}]},function(t,e){var r,o,e=1<arguments.length&&void 0!==e?e:0;null!=(r=window)&&r.drawEchartsDom&&(o=window.echarts.init(window.drawEchartsDom,t),1===e&&(o.dispose(),o=window.echarts.init(window.drawEchartsDom,t)),o.setOption(window.drawEchartsOption),window.addEventListener("resize",function(){return o.resize()}))}(dataTheme))}}],n=r.prototype,i=o,a=0;a<i.length;a++){var c=i[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(n,(e=function(t){if("object"!==s(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!==s(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(c.key),"symbol"===s(e)?e:String(e)),c)}return Object.defineProperty(r,"prototype",{writable:!1}),t}();document.addEventListener("DOMContentLoaded",function(){return window.CategoriesClass=new t})})();