{ "pandav:/index.js": { "cubeCode": "Cube('pandav:/com/ml-line-double/3.0.19',['pandav:/npm/bcore/0.0.22/event','pandav:/npm/lodash/4.17.11','pandav:/com/ml-line-double/3.0.19/line','pandav:/com/legend/0.1.5','pandav:/com/ml-line-double/3.0.19/defaultConfig','pandav:/npm/jquery/2.1.4'],function(a,b,c){function d(a){if(!a||!a.series)return[];var b=a.series,c=b.series1,d=b.series2,e=[];return c&&e.push({showName:c.serieName,color:c.line.color}),d&&e.push({showName:d.serieName,color:d.line.color}),e}var e=c('pandav:/npm/bcore/0.0.22/event'),f=c('pandav:/npm/lodash/4.17.11'),g=c('pandav:/com/ml-line-double/3.0.19/line'),h=c('pandav:/com/legend/0.1.5'),i=c('pandav:/com/ml-line-double/3.0.19/defaultConfig'),j=c('pandav:/npm/jquery/2.1.4');return a.exports=e.extend(function(a,b){this.config=f.cloneDeep(i),this.container=j(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.chart.legend,e=c.layout.loc.split('-')[0];this.chartDom=j('
'),this.legendDom=j('
'),'bottom'===e?(this.container.append(this.chartDom),this.container.append(this.legendDom)):(this.container.append(this.legendDom),this.container.append(this.chartDom)),this.legend=new h(this.legendDom[0],c),this.legend.render(d(b),c),this.chartDom.height(this.container.height()-(c.show&&this.legendDom.height()||0)),this.chart=new g(this.chartDom[0],f.cloneDeep(b)),this.legendDom.css('display',c.show&&'block'||'none'),this._bindEvent()},render:function(a,b){var c=this.mergeConfig(b&&(b.options||b));a=this.data(a),a&&a.length&&(this.legend.render(d(c),c.chart.legend),this.chartDom.height(this.container.height()-(c.chart.legend.show&&this.legendDom.height()||0)),a&&this.chart.render(a,c),this._cfg=c)},updateStyle:function(){},updateOptions:function(a){var b=a&&(a.options||a),c=b.chart.legend,d=this.config.chart.legend;f.isEqual(c,d)||this.updateLegendLayout(c,!0),this.render(null,a)},setColors:function(){},data:function(a){return a&&(this._data=f.clone(a)),this._data.length&&this._data.forEach(function(a){a.y=f.toNumber(a.y)}),this._data},mergeConfig:function(a){return a?(this.config.theme=f.defaultsDeep(a.theme||{},this.config.theme),this.setColors(),a.series&&(this.config.series=a.series),this.config=f.defaultsDeep(a||{},this.config),this.config):this.config},resize:function(a,b){this.chart.resize(a,b-(this.config.chart.legend.show&&this.legendDom.outerHeight()||0)-20)},updateLegendLayout:function(a,b){var c=this.config.chart.legend;if(c.show!==a.show&&(this.legendDom.css('display',a.show&&'block'||'none'),this.config.chart.height=this.container.height()-(a.show&&this.legendDom.outerHeight()||0)),c.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(c.layout.margin)!==JSON.stringify(a.layout.margin)){var d=a.layout.margin;this.legendDom.find('.legend-item').css('margin',d.vertiInterval+'px '+d.horiInterval+'px'),this.config.chart.height=this.container.height()-(a.show&&this.legendDom.outerHeight()||0)}var e=c.layout.loc.split('-')[0],f=a.layout.loc.split('-')[0];e!==f&&('top'===f?this.container[0].appendChild(this.chartDom[0]):'bottom'===f&&this.container[0].appendChild(this.legendDom[0])),b||this.render(null,{chart:{legend:a}})},clear:function(){this.chart&&this.chart.clear(),this.legend&&f.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;if(a&&a.animationUpdateFromPrevious){var 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\\n '+(e?e+': ':'')+(d&&d.value||d)+''}function k(a,b,c){if(!a)return{};var e=m.cloneDeep(a),f=a.trigger,g=a.axisPointer,h=a.textStyle,i=a.bgBox;f&&f.action&&(e.triggerMethod=f.action),f&&f.type&&(e.trigger=f.type),a.beforeFormat&&(e.beforeFormat=a.beforeFormat);var k=m.get(b,'axis.yaxis.format'),l=m.get(b,'axis.zaxis.format'),n=function(a){return a},o=function(a){return a};k&&k.includes('%')&&(n=p.format(''+k)),l&&l.includes('%')&&(o=p.format(''+l));var r=!b.chart.emptyData;if(e.formatter=function(g,a,d){var f='
',h=b.border,i=[],k=c.length,l=h.series1,m=h.series2;return'axis'===e.trigger?(g.x&&i.push(''+g.x.toString()+''),g.y&&g.y.forEach(function(a){var b=q.getDisplayValueFromData(a&&a.value),c=r&&a.__isNull;c||i.push(j({color:l&&l.line.color,value:n(b)}))}),g.z&&g.z.forEach(function(a){var b=q.getDisplayValueFromData(a&&a.value),c=r&&a.__isNull;c||i.push(j({color:m&&m.line.color,value:o(b)}))})):i.push(j({color:(1<=d/k?l:m).line.color,value:1<=d/k?n(g.y&&g.y[0].value||0):o(g.z&&g.z[0].value||0),key:g.x.toString()})),f+=i.join('')+'
',f},void 0!==a.enterFocus&&(e.enterFocus=a.enterFocus),void 0!==a.hideDelay&&(e.hideDelay=a.hideDelay),g&&g._type&&(e.axisPointer=g._type),g&&g.lineStyle&&(e.lineStyle=g.lineStyle),h&&(e.color=h.color,e.fontSize=h.fontSize+'px',e.fontFamily=h.fontFamily,e.fontWeight=h.fontWeight),i){var s=i.offset,t=i.border,u=i.customSize;e.backgroundColor=i.backgroundColor,s&&void 0!==s.xOffset&&(e.xOffset=s.xOffset),s&&void 0!==s.yOffset&&(e.yOffset=s.yOffset),u&&(e.autoSize=!u.show,e.width=u.width,e.height=u.height),t&&(t.borderColor&&(e.borderColor=t.borderColor),void 0!==t.borderWidth&&(e.borderWidth=t.borderWidth))}return e}var l=c('pandav:/npm/bcore/0.0.22/event'),m=c('pandav:/npm/lodash/4.17.11'),n=c('pandav:/npm/jquery/2.1.4'),o=c('pandav:/npm/dchart-line-with-point-area-double/0.2.34'),p=c('pandav:/npm/d3/3.5.12'),q=c('pandav:/com/maliang-utils/0.0.24'),r=Symbol();return a.exports=l.extend(function(a,b){this.config={theme:{},chart:{},tooltip:{show:!0,trigger:'item',triggerMethod:'hover',beforeFormat:null,formatter:'doubleLineChart',enterFocus:!0,axisPointer:{show:!0,_type:'line',lineStyle:{color:'#f00',width:1,_type:'solid'}},hideDelay:300,textStyle:{color:'#fff',fontSize:14,fontFamily:'Microsoft Yahei',fontWeight:'normal'},bgBox:{color:'rgba(0, 0, 0, 0.65)',padding:10,xOffset:6,yOffset:10,customSize:{show:!1,width:300,height:150},borderColor:'#333',borderWidth:0}}},this.container=n(a),this.apis=b.apis,this._data=null,this.chart=null,this.init(b)},{init:function(a){this.mergeConfig(a),this.updateLayout(),this.chart=new o(this.container[0],this._getChartOptions()),this.chart.updateBeforeRender=this.chart.beforeRender},_getChartOptions:function(a){a=a||this._data;var b=m.cloneDeep(this.config),c=b.axis,d=b.chart,e=b.series,j=b.others,l={};l.chart=m.clone(d);var n=c.xaxis,o=c.yaxis,p=c.zaxis;l.xaxis=f(n,a),l.yaxis=g(o),l.zaxis=g(p),l.series=i(e.series1,l.yaxis,'y'),l.series2=i(e.series2,l.zaxis,'z'),l.legend=d.legend,l.legend.show=!1,l.beforeLayout=null,l.margin=d.margin;var q=d.margin,r=q.right,s=q.top;return l.margin.top=s||l.yaxis.show&&l.yaxis.textShow&&l.yaxis.label&&3*l.yaxis.fontSize||0,l.margin.right=r||l.xaxis.show&&l.xaxis.textShow&&l.xaxis.label&&2*(l.xaxis.label.length*l.xaxis.fontSize)||0,l.hiddenEmptyData=!d.margin.emptyData,Object.assign(l,h(j.animation)),l.tooltip=k(j.tooltip,b,a),l},data:function(a,b){b=this.mergeConfig(b),a&&this.setOriginalData(a),a||(a=this.getOriginalData());var c=b&&b.chart&&b.chart.loadAmount||2e3;c&&(a=a.slice(0,c));var d=!b.chart.emptyData;return a&&a.length&&(this.__data=m.cloneDeep(a).map(function(a){return a.y={value:a.y||0,data:m.omit(a,'z'),__isNull:d&&!a.y},a.z={value:a.z||0,data:m.omit(a,'y'),__isNull:d&&!a.z},a})),this._data=this.hasS(this.__data)?q.threeD2Two(this.__data,'x','y','s',q.getSeriesValue(this.config.series,'value'),'time'===this.config.xaxis.label.category&&function(b,c){return b