{ "pandav:/index.js": { "cubeCode": "Cube('pandav:/com/ml-bar-with-line/2.6.0',['pandav:/npm/bcore/0.0.22/event','pandav:/npm/lodash/4.17.11','pandav:/com/ml-bar-with-line/2.6.0/legend','pandav:/com/ml-bar-with-line/2.6.0/bar','pandav:/npm/jquery/2.1.4'],function(a,b,c){var d=c('pandav:/npm/bcore/0.0.22/event'),e=c('pandav:/npm/lodash/4.17.11'),f=c('pandav:/com/ml-bar-with-line/2.6.0/legend'),g=c('pandav:/com/ml-bar-with-line/2.6.0/bar'),h=c('pandav:/npm/jquery/2.1.4');return a.exports=d.extend(function(a,b){this.config={theme:{},chart:{background:'transparent',margin:{top:36,bottom:0,left:20,right:0}},label:{},axis:{xaxis:{tickSize:1,dy:10},yaxis:{tickSize:2}},legend:{innerStyle:{\"line-height\":1.3}},series:[{value:'1',color:'#2F8FBE'}],animation:{show:!0,animationDuration:1e3,animationEasing:'cubicInOut',animationDurationUpdate:300,animationUpdateFromPrevious:!0,animationAfterPreviousSeries:!1}},this.container=h(a).css('padding','10px 0'),this.chart=null,this.legend=null,this.init(b)},{init:function(a){this.apis=a.apis;var b=this.mergeConfig(a),c=b.legend,d=c.layout.loc.split('-')[0];this.chartDom=h('
'),this.legendDom=h(''),'bottom'===d?(this.container.append(this.chartDom),this.container.append(this.legendDom)):(this.container.append(this.legendDom),this.container.append(this.chartDom)),this.legend=new f(this.legendDom[0],b.legend);var i=[];b.series.length&&b.series.forEach(function(a){a.bar.show&&i.push({showName:a.bar.showName,color:a.bar.color}),a.line.show&&i.push({showName:a.line.showName,color:a.line.color})}),this.legend.render(i,b.legend),this.chartDom.height(this.container.height()-(b.legend.show&&this.legendDom.height()||0)),this.chart=new g(this.chartDom[0],e.cloneDeep(b)),this.legendDom.css('display',c.show&&'block'||'none'),this._bindEvent(),this.observeStyle()},observeStyle:function(){var a=this,b=new MutationObserver(function(b){b.forEach(function(b){'attributes'===b.type&&'block'===e.get(b.target,'style.display')&&a.render(null,a.config)})});b.observe(h(this.container).parent()[0],{attributes:!0,attributeFilter:['style']})},render:function(a,b){var c=this.mergeConfig(b);if(a=this.data(a),a&&a.length){var d=[];c.series.length&&c.series.forEach(function(a){a.bar.show&&d.push({showName:a.bar.showName,color:a.bar.color}),a.line.show&&d.push({showName:a.line.showName,color:a.line.color})}),this.legend.render(d,c.legend),this.chartDom.height(this.container.height()-(c.legend.show&&this.legendDom.height()||0)),a&&this.chart.render(a,c),this._cfg=c}},updateStyle:function(){},setColors:function(){},data:function(a){return a&&(this._data=e.clone(a)),this._data},mergeConfig:function(a){return a?(this.config.theme=e.defaultsDeep(a.theme||{},this.config.theme),this.setColors(),a.series&&(this.config.series=a.series),this.config=e.defaultsDeep(a||{},this.config),this.config.legend.textarea.fontFamily=this.config.chart.fontFamily,this.config):this.config},resize:function(a,b){this.chart.resize(a,b-(this.config.legend.show&&this.legendDom.outerHeight()||0)-20)},updateLegendLayout:function(a){var b=this.config.legend;if(b.show!==a.show&&(this.legendDom.css('display',a.show&&'block'||'none'),this.config.chart.height=this.container.height()-(a.show&&this.legendDom.outerHeight()||0)),b.textarea.fontSize!==a.textarea.fontSize&&(this.legendDom.find('.legend-item').css('fontSize',a.textarea.fontSize),this.config.chart.height=this.container.height()-(a.show&&this.legendDom.outerHeight()||0)),JSON.stringify(b.layout.margin)!==JSON.stringify(a.layout.margin)){var c=a.layout.margin;this.legendDom.find('.legend-item').css('margin',c.vertiInterval+'px '+c.horiInterval+'px'),this.config.chart.height=this.container.height()-(a.show&&this.legendDom.outerHeight()||0)}var d=b.layout.loc.split('-')[0],e=a.layout.loc.split('-')[0];d!==e&&('top'===e?this.container[0].appendChild(this.chartDom[0]):'bottom'===e&&this.container[0].appendChild(this.legendDom[0])),this.render(null,{legend:a})},clear:function(){this.chart&&this.chart.clear(),this.legend&&e.isFunction(this.legend.clear)&&this.legend.clear()},destroy:function(){this.chart&&this.chart.destroy(),this.chart=null,this.legend&&this.legend.destroy(),this.legend=null,this.chartDom=null,this.legendDom=null,this.container&&this.container.empty(),this._data=null},startAnimate:function(){if(!(this.chart&&this.chart.chart&&this.chart.chart))return!1;if(this._cfg){this.chart.chart.clearAllAnimation();var a=this._cfg.animation,b=a.animationUpdateFromPrevious;a.animationUpdateFromPrevious=!1;var c=a.animationDurationUpdate;a.animationDurationUpdate=a.animationDuration,this.chart.render(),a.animationDurationUpdate=c,a.animationUpdateFromPrevious=b}},clearAnimate:function(){this.chart&&this.chart.chart&&this.chart.chart.resumeToAnimationEnd()},_bindEvent:function(){if(this.chart&&this.chart.chart){var a=this.chart.chart,b=this;['click'].forEach(function(c){a.on(c,function(a){var d=a.data;return b.emit(c,d)})})}},highlight:function(){var a=0