UNPKG

@tusharghoshbd/ngx-charts

Version:

Ngx charts is an angular library for presenting data in chart.

16 lines 71.5 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("d3-scale"),require("d3-shape")):"function"==typeof define&&define.amd?define("@tusharghoshbd/ngx-charts",["exports","@angular/core","@angular/common","d3-scale","d3-shape"],e):e(((t=t||self).tusharghoshbd=t.tusharghoshbd||{},t.tusharghoshbd["ngx-charts"]={}),t.ng.core,t.ng.common,t.d3Scale,t.d3Shape)}(this,(function(t,e,i,o,n){"use strict";
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */var s=function(){return(s=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}).apply(this,arguments)};function r(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var o,n,s=i.call(t),r=[];try{for(;(void 0===e||e-- >0)&&!(o=s.next()).done;)r.push(o.value)}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return r}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(r(arguments[e]));return t}function l(t,e){return void 0===e&&(e=5),"string"!=typeof t?"number"==typeof t?t+"":"":(t=t.trim()).length<=e?t:t.slice(0,e)+"..."}var h=function(){function t(){this.categories=[],this.series=[],this.xAxisHeightChange=new e.EventEmitter,this.ticks=[],this.trimLabel=l}return t.prototype.ngOnChanges=function(t){this.update()},t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e=parseInt(t.xAxisHeightEl.nativeElement.getBoundingClientRect().height,10)+10;e!==t.options.xAxis.height&&t.xAxisHeightChange.emit({xAxisHeight:e})}),0)},t.prototype.update=function(){"vertical"==this.options.barType?this.ticks=this.yScale.nice().ticks():this.ticks=this.xScale.nice().ticks(),this.ngAfterViewInit()},t.prototype.xTransformRotate=function(t){if("vertical"==this.options.barType&&this.xScale){var e=this.xScale(t)+this.xScale.bandwidth()/2+this.options.yAxis.width;return isNaN(e)?"rotate(0,0,0)":"rotate("+this.options.xAxis.labelRotation+", "+(this.xScale(t)+this.xScale.bandwidth()/2+this.options.yAxis.width)+", "+(this.options.height-20)+")"}return"rotate("+this.options.xAxis.labelRotation+", "+(this.xScale(t)+this.options.yAxis.width)+", "+(this.options.height-this.options.xAxis.height+20)+")"},t.prototype.pathDirection=function(t){return"M "+(this.xScale(t)+this.options.yAxis.width)+" "+this.options.header.height+" L "+(this.xScale(t)+this.options.yAxis.width)+" "+(this.options.height-this.options.xAxis.height)},t.decorators=[{type:e.Component,args:[{selector:"g[x-axis]",template:'\n<svg>\n    <g #xAxisHeightEl data-z-index="20" height="70"> \n        <g class="highcharts-axis highcharts-yaxis" data-z-index="2" aria-hidden="true" >\n            <text [attr.x]="options.width/2" [attr.y]="options.height-10" text-anchor="middle" dominant-baseline="central"  style="margin-bottom: 50px; color:#666666;cursor:default;font-size:11px;fill:#666666;"\n                class="highcharts-axis-title"\n                >\n                {{options.xAxis ? options.xAxis.title : ""}}\n            </text>\n        </g>\n        \n        <g class="highcharts-axis-labels highcharts-xaxis-labels" data-z-index="7" aria-hidden="true"\n            *ngIf="options.barType == \'vertical\'">\n            <text \n                *ngFor="let item of categories; let i = index;let f = first;"\n                [attr.x] = " xScale(item) != undefined  ? xScale(item) + (xScale.bandwidth()/2)+options.yAxis.width : 0"\n                [attr.y] = "options.height-30"\n                [attr.transform]="xTransformRotate(item)"\n                [attr.text-anchor]="options.xAxis.labelAlign"\n                style="color:#666666;cursor:default;font-size:11px;fill:#666666;"\n                opacity="1">{{ options.xAxis.labelEllipsis ? trimLabel(item,  options.xAxis.labelEllipsisSize) :item}}</text>\n        </g> \n\n        <g class="highcharts-axis-labels highcharts-yaxis-labels" data-z-index="7" aria-hidden="true"\n            *ngIf="options.barType == \'horizontal\'">\n            <text style="color:#666666;cursor:default;font-size:11px;fill:#666666;" \n                text-anchor="middle"\n                *ngFor="let tick of ticks" \n                [attr.x] = \'xScale(tick) + options.yAxis.width\'\n                [attr.y] = "options.height - 30"\n                [attr.transform]="xTransformRotate(tick)"\n                opacity="1">{{ options.xAxis.labelEllipsis ? trimLabel(tick,  options.xAxis.labelEllipsisSize) :tick}}</text>\n        </g>\n    </g>\n    <g *ngIf="options.barType == \'horizontal\'" class="highcharts-grid highcharts-yaxis-grid" data-z-index="1" aria-hidden="true">\n        <path fill="none" stroke="#e6e6e6" stroke-width="1" data-z-index="1" class="highcharts-grid-line"\n            *ngFor="let tick of ticks" [attr.d]="pathDirection(tick)" opacity="1">\n        </path>\n    </g>\n</svg>\n',styles:[""]}]}],t.ctorParameters=function(){return[]},t.propDecorators={xScale:[{type:e.Input}],yScale:[{type:e.Input}],options:[{type:e.Input}],categories:[{type:e.Input}],series:[{type:e.Input}],xAxisHeightEl:[{type:e.ViewChild,args:["xAxisHeightEl",{read:e.ElementRef,static:!1}]}],xAxisHeightChange:[{type:e.Output}]},t}();var p=function(){function t(){this.categories=[],this.series=[],this.yAxisWidthChange=new e.EventEmitter,this.ticks=[],this.rightTicks=[],this.trimLabel=l}return t.prototype.ngOnInit=function(){},t.prototype.ngOnChanges=function(t){this.update()},t.prototype.ngAfterViewInit=function(){var t=this;setTimeout((function(){var e=parseInt(t.yAxisWidthEl.nativeElement.getBoundingClientRect().width,10)+30,i=parseInt(t.yAxisWidthEl.nativeElement.getBoundingClientRect().height,10)+300,o=parseInt(t.yAxisRightWidthEl.nativeElement.getBoundingClientRect().width,10)+30;i===t.options.yAxis.height&&e===t.options.yAxis.width||t.yAxisWidthChange.emit({yAxisWidth:e,yAxisHeight:i,yAxisRightWidth:o})}),0)},t.prototype.update=function(){"vertical"==this.options.barType&&(this.yScale&&(this.ticks=this.yScale.nice().ticks()),this.yRightScale&&(this.rightTicks=this.yRightScale.nice().ticks())),this.ngAfterViewInit()},t.prototype.transform=function(t){return"rotate(270, "+t+", "+this.options.height/2+")"},t.prototype.pathDirection=function(t){return"M "+this.options.yAxis.width+" "+(this.yScale(t)+this.options.header.height)+" L "+(this.options.plotBackground.width+this.options.yAxis.width)+" "+(this.yScale(t)+this.options.header.height)},t.prototype.calculateYTextPosition=function(t){return this.yScale(t)?parseInt(this.yScale(t)+this.yScale.bandwidth()/2+this.options.header.height):this.options.header.height},t.decorators=[{type:e.Component,args:[{selector:"g[y-axis]",template:'<svg>\n    <g #yAxisWidthEl>\n        <g class="highcharts-axis highcharts-yaxis" data-z-index="2" aria-hidden="true">\n            <text x="10" [attr.y]="options.height/2" text-anchor="middle" dominant-baseline="central" \n                style="color:#666666;cursor:default;font-size:11px;fill:#666666;" \n                class="highcharts-axis-title"\n                [attr.transform]="transform(10)">\n                {{options.yAxis ? options.yAxis.title : ""}}\n            </text>\n        </g>\n        <g class="highcharts-axis-labels highcharts-yaxis-labels" data-z-index="7" aria-hidden="true"\n            *ngIf="options.barType == \'vertical\'">\n            <text\n                style="color:#666666;cursor:default;font-size:11px;fill:#666666;" \n                text-anchor="start"\n                *ngFor="let tick of ticks" \n                [attr.x]="30"\n                [attr.y]="yScale(tick)+this.options.header.height" \n                opacity="1">{{ options.yAxis.labelEllipsis ? trimLabel(tick,  options.yAxis.labelEllipsisSize) :tick}} </text>\n        </g>\n        <g class="highcharts-axis-labels highcharts-xaxis-labels" data-z-index="7" aria-hidden="true"\n            *ngIf="options.barType == \'horizontal\'">\n            <text \n                *ngFor="let item of categories; let i = index;"\n                [attr.x] = "30"\n                [attr.y] = "calculateYTextPosition(item)"\n                style="color:#666666;cursor:default;font-size:11px;fill:#666666;" text-anchor="right" \n                 opacity="1">{{ options.yAxis.labelEllipsis ? trimLabel(item,  options.yAxis.labelEllipsisSize) :item}}</text>\n        </g> \n    </g>\n\n    <g #yAxisRightWidthEl>\n        <g *ngIf= "yRightScale" class="highcharts-axis highcharts-yaxis" data-z-index="2" aria-hidden="true" >\n            <text \n                [attr.x]="options.width - 10" \n                [attr.y]="options.height/2" text-anchor="middle" dominant-baseline="central" \n                style="color:#666666;cursor:default;font-size:11px;fill:#666666;" \n                class="highcharts-axis-title"\n                [attr.transform]="transform(options.width  - 10)">\n                {{options.yAxis ? options.yAxis.rightTitle : ""}}\n            </text>\n        </g>\n        <g  class="highcharts-axis-labels highcharts-yaxis-labels" data-z-index="7" aria-hidden="true"\n            *ngIf="options.barType == \'vertical\' && yRightScale">\n            <text\n                style="color:#666666;cursor:default;font-size:11px;fill:#666666;" \n                text-anchor="end"\n                *ngFor="let tick of rightTicks" \n                [attr.x]="options.width - 30"\n                [attr.y]="yRightScale(tick)+this.options.header.height" \n                opacity="1">{{ options.yAxis.labelEllipsis ? trimLabel(tick,  options.yAxis.labelEllipsisSize) :tick}} </text>\n        </g>\n    </g>\n    \n    <g *ngIf="options.barType == \'vertical\'" class="highcharts-grid highcharts-yaxis-grid" data-z-index="1" aria-hidden="true">\n        <path fill="none" stroke="#e6e6e6" stroke-width="1" data-z-index="1" class="highcharts-grid-line"\n            *ngFor="let tick of ticks" [attr.d]="pathDirection(tick)" opacity="1">\n        </path>\n    </g>\n\n</svg>',styles:[""]}]}],t.ctorParameters=function(){return[]},t.propDecorators={xScale:[{type:e.Input}],yScale:[{type:e.Input}],yRightScale:[{type:e.Input}],options:[{type:e.Input}],categories:[{type:e.Input}],series:[{type:e.Input}],yAxisWidthEl:[{type:e.ViewChild,args:["yAxisWidthEl",{static:!0}]}],yAxisRightWidthEl:[{type:e.ViewChild,args:["yAxisRightWidthEl",{static:!0}]}],yAxisWidthChange:[{type:e.Output}]},t}();var d=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule],declarations:[h,p],exports:[h,p]}]}],t}(),c=function(){function t(){this.headerHeightChange=new e.EventEmitter}return t.prototype.ngOnChanges=function(t){this.update()},t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){var t=parseInt(this.headerHeightEl.nativeElement.getBoundingClientRect().height,10)+20;this.headerHeightChange.emit({headerHeight:t})},t.prototype.update=function(){},t.decorators=[{type:e.Component,args:[{selector:"g[header]",template:'\r\n<svg>\r\n\r\n    <g #headerHeightEl>\r\n\r\n        <text [attr.x]="options.width/2" text-anchor="middle" class="highcharts-title" data-z-index="4" style="color:#333333;font-size:18px;fill:#333333;" y="24" aria-hidden="true">\r\n            <tspan>{{options.title}}</tspan>\r\n        </text>\r\n        <text [attr.x]="options.width/2" text-anchor="middle" class="highcharts-subtitle" data-z-index="4" style="color:#666666;fill:#666666;" y="52" aria-hidden="true">\r\n            <tspan>{{options.subtitle}}</tspan>\r\n        </text>\r\n        \x3c!-- <g class="highcharts-axis highcharts-yaxis" data-z-index="2" aria-hidden="true" >\r\n            <text [attr.x]="options.width/2" [attr.y]="options.height-10" text-anchor="middle" dominant-baseline="central"  style="margin-bottom: 50px; color:#666666;cursor:default;font-size:11px;fill:#666666;"\r\n                class="highcharts-axis-title"\r\n                >\r\n                {{options.xAxis ? options.xAxis.title : ""}}\r\n            </text>\r\n        </g> --\x3e\r\n    </g>\r\n \r\n</svg>',styles:[""]}]}],t.ctorParameters=function(){return[]},t.propDecorators={options:[{type:e.Input}],headerHeightEl:[{type:e.ViewChild,args:["headerHeightEl",{static:!0}]}],headerHeightChange:[{type:e.Output}]},t}();var g=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule],declarations:[c],exports:[c]}]}],t}(),u=function(){function t(){this.trimLabel=l}return t.prototype.ngOnChanges=function(t){this.update()},t.prototype.ngOnInit=function(){},t.prototype.ngAfterViewInit=function(){},t.prototype.update=function(){},t.decorators=[{type:e.Component,args:[{selector:"chart-legend",template:'<div class="chart-legend ng-tns-c30-0 ng-star-inserted" [style.width]="options.width+\'px\'">\r\n    <div style="text-align: center;">\r\n        <div class="legend-wrap">\r\n            <ul class="legend-labels" style="max-height: 255px;">\r\n                <li class="legend-label ng-star-inserted"\r\n                  *ngFor="let gn of groupName;let i=index"  \r\n                >\r\n                    <div  *ngIf="gn.name">\r\n                        <span class="legend-label-color" \r\n                            [style.background-color] = "gn.color"> </span>\r\n                        <span class="legend-label-text">\r\n                            {{ options.legend.labelEllipsis ? trimLabel(gn.name,  options.legend.labelEllipsisSize) :gn.name}}\r\n                        </span>\r\n                    </div>\r\n                </li>\r\n            </ul>\r\n        </div>\r\n    </div>\r\n</div>',styles:[".chart-legend ul li{display:inline-block}.chart-legend{text-align:center;display:inline-block;padding:0}.chart-legend .legend-label{text-align:center;cursor:pointer;font-size:90%;margin:8px;color:#afb7c8}.chart-legend li,.chart-legend ul{padding:0;margin:0;list-style:none}.chart-legend .legend-labels{line-height:85%;list-style:none;float:left;width:100%;border-radius:3px;overflow-y:auto;overflow-x:hidden;white-space:nowrap}.chart-legend .legend-label-color{display:inline-block;height:15px;width:15px;margin-right:5px;color:#5b646b;border-radius:3px}.chart-legend .legend-label-text{display:inline-block;vertical-align:top;line-height:15px;font-size:12px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}"]}]}],t.ctorParameters=function(){return[]},t.propDecorators={groupName:[{type:e.Input}],series:[{type:e.Input}],options:[{type:e.Input}]},t}();var x=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule],declarations:[u],exports:[u]}]}],t}(),y=function(){function t(t,e){this.el=t,this.renderer=e,this.offset=10}return t.prototype.onMouseEnter=function(){this.tooltip||this.show()},t.prototype.onMouseLeave=function(){this.tooltip&&this.hide()},t.prototype.show=function(){this.create(),this.setPosition(),this.renderer.addClass(this.tooltip,"ng-tooltip-show")},t.prototype.hide=function(){var t=this;this.renderer.removeClass(this.tooltip,"ng-tooltip-show"),window.setTimeout((function(){t.renderer.removeChild(document.body,t.tooltip),t.tooltip=null}),this.delay)},t.prototype.create=function(){this.tooltip=this.renderer.createElement("span"),this.renderer.appendChild(this.tooltip,this.renderer.createText(this.tooltipTitle)),this.renderer.appendChild(document.body,this.tooltip),this.renderer.addClass(this.tooltip,"ng-tooltip"),this.renderer.addClass(this.tooltip,"ng-tooltip-"+this.placement),this.renderer.setStyle(this.tooltip,"border","2px solid "+this.tooltipColor),this.renderer.setStyle(this.tooltip,"-webkit-transition","opacity "+this.delay+"ms"),this.renderer.setStyle(this.tooltip,"-moz-transition","opacity "+this.delay+"ms"),this.renderer.setStyle(this.tooltip,"-o-transition","opacity "+this.delay+"ms"),this.renderer.setStyle(this.tooltip,"transition","opacity "+this.delay+"ms")},t.prototype.setPosition=function(){var t,e,i=this.el.nativeElement.getBoundingClientRect(),o=this.tooltip.getBoundingClientRect(),n=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;"top"===this.placement&&(t=i.top-o.height-this.offset,e=i.left+(i.width-o.width)/2),"bottom"===this.placement&&(t=i.bottom+this.offset,e=i.left+(i.width-o.width)/2),"left"===this.placement&&(t=i.top+(i.height-o.height)/2,e=i.left-o.width-this.offset),"right"===this.placement&&(t=i.top+(i.height-o.height)/2,e=i.right+this.offset),this.renderer.setStyle(this.tooltip,"top",t+n+"px"),this.renderer.setStyle(this.tooltip,"left",e+"px")},t.decorators=[{type:e.Directive,args:[{selector:"[tooltip]"}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.Renderer2}]},t.propDecorators={tooltipTitle:[{type:e.Input,args:["tooltip"]}],placement:[{type:e.Input}],delay:[{type:e.Input}],tooltipColor:[{type:e.Input}],onMouseEnter:[{type:e.HostListener,args:["mouseenter"]}],onMouseLeave:[{type:e.HostListener,args:["mouseleave"]}]},t}();var f=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[i.CommonModule],declarations:[y],exports:[y]}]}],t}(),m=function(){function t(t,e){this.options=t,this.series=e}return t.prototype.generateColorScale=function(){for(var t=["#7cb5ec","#434348","#f7a35c","#90ed7d","#8085E9","#F15C80","#E4D354","#2B908F","#F45B5B","#91E8E1","#7aa3e5","#a27ea8","#aae3f5","#adcded","#a95963","#8796c0","#7ed3ed","#50abcc","#ad6886"],e=[],i=[],n=0;n<this.series.length;n++)if(i.push(this.series[n].name),this.series[n].colorCode)e.push(this.series[n].colorCode);else{var s=n%t.length;e.push(t[s])}return o.scaleOrdinal().range(e).domain(i)},t}();var b=function(){function t(t,e,i){this.chartElement=e,this.cdr=i,this.customOptions={barType:"vertical",title:"",subtitle:"",height:0,width:0,padding:5,xAxis:{title:"",height:0,labelRotation:0,labelAlign:"left",labelEllipsis:!1,labelEllipsisSize:16},yAxis:{title:"",width:0,height:0,labelRotation:0,labelEllipsis:!1,labelEllipsisSize:16},legend:{labelEllipsis:!1,labelEllipsisSize:16},plotBackground:{x:0,y:0,height:0,width:0},plotOptions:{groupBarPadding:20,innerBarPadding:3},header:{height:0,width:0}},this._options={},this.categories=[],this.series=[],this.bars=[],this.groupName=[],this.element=t.nativeElement,this.trimLabel=l}return Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(t){var e=t.xAxis;e.labelEllipsis=null!=t.xAxis.labelEllipsisSize&&t.xAxis.labelEllipsisSize>0;var i=t.yAxis;i.labelEllipsis=null!=t.yAxis.labelEllipsisSize&&t.yAxis.labelEllipsisSize>0;var o=t.legend;o.labelEllipsis=null!=t.legend.labelEllipsisSize&&t.legend.labelEllipsisSize>0;var n=t.plotBackground,r=t.plotOptions,a=t.header;delete t.xAxis,delete t.yAxis,delete t.legend,delete t.plotBackground,delete t.plotOptions,delete t.header,this._options=s({},this.customOptions,t,{xAxis:s({},this.customOptions.xAxis,e),yAxis:s({},this.customOptions.yAxis,i),legend:s({},this.customOptions.legend,o),plotBackground:s({},this.customOptions.plotBackground,n),plotOptions:s({},this.customOptions.plotOptions,r),header:s({},this.customOptions.header,a)})},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){var e=this;this.groupBarPaddingBK=this.options.plotOptions.groupBarPadding,this.innerBarPaddingBK=this.options.plotOptions.innerBarPadding,setTimeout((function(){return e.update()}))},t.prototype.ngOnInit=function(){this.options.width=this.options.width,this.options.height=this.options.height,this.update()},t.prototype.update=function(){var t=this,e=this.chartElement.nativeElement,i=null!==e.parentNode?e.parentNode.getBoundingClientRect():{height:400,width:800},o=e.parentNode.currentStyle||window.getComputedStyle(e.parentNode);this.options.height=this.options.height?this.options.height:i.height-this.strToNumber(o.paddingLeft)-this.strToNumber(o.paddingRight),this.options.width=(this.options.width,i.width-this.strToNumber(o.paddingLeft)-this.strToNumber(o.paddingRight)),this.calPlotBackground();var n=!1;this.options.plotOptions.groupBarPadding=this.groupBarPaddingBK,this.options.plotOptions.innerBarPadding=this.innerBarPaddingBK;do{1==n&&(this.options.plotOptions.groupBarPadding--,this.options.plotOptions.innerBarPadding=2),"vertical"==this.options.barType?this.xScale=this.getXScale():this.yScale=this.getXScale(),this.innerScale=this.getInnerScale(),n=!0}while(this.innerScale.bandwidth()<2);"vertical"==this.options.barType?this.yScale=this.getYScale():this.xScale=this.getYScale();var s=new m(this.options,this.series);this.colorScale=s.generateColorScale(),setTimeout((function(){t.groupName=[],t.series.map((function(e){e.name&&t.groupName.push({name:e.name,color:t.colorScale(e.name)})})),t.createBar()})),this.cdr.detectChanges()},t.prototype.getXScale=function(){var t,e;if("vertical"==this.options.barType)t=this.categories.length/(this.options.plotBackground.width/this.options.plotOptions.groupBarPadding),e=[0,this.options.plotBackground.width];else{this.options.height,this.options.header.height;t=this.categories.length/(this.options.plotBackground.height/this.options.plotOptions.groupBarPadding),e=[0,this.options.plotBackground.height]}return o.scaleBand().range(e).paddingInner(t).paddingOuter(.1).domain(this.categories)},t.prototype.getInnerScale=function(){for(var t,e,i=[],n=0;n<this.series.length;n++)i.push(this.series[n].name);return"vertical"==this.options.barType?(t=this.series.length/(this.xScale.bandwidth()/this.options.plotOptions.innerBarPadding),e=this.xScale.bandwidth()):(t=this.series.length/(this.yScale.bandwidth()/this.options.plotOptions.innerBarPadding),e=this.yScale.bandwidth()),o.scaleBand().range([0,e]).paddingInner(t).domain(i)},t.prototype.getYScale=function(){var t=new Set;this.series.map((function(e){e.data.map((function(e){t.add(e)}))}));var e=Math.min.apply(Math,a(t));e=e>0?0:e;var i=Math.max.apply(Math,a([0],t));i=i>0?i:0;var n=[];"vertical"==this.options.barType?n=[this.options.plotBackground.height,0]:n=[0,this.options.plotBackground.width-30];return o.scaleLinear().range(n).domain([e,i])},t.prototype.calPlotBackground=function(){this.options=s({},this.options,{plotBackground:s({},this.options.plotBackground,{x:0,y:0,height:this.options.height-this.options.xAxis.height-this.options.header.height-this.options.padding,width:this.options.width-this.options.yAxis.width-this.options.padding})})},t.prototype.createBar=function(){var t=this;this.bars=[],"vertical"==this.options.barType?this.categories.map((function(e,i){for(var o=0;o<t.series.length;o++){var n={value:e,data:t.series[o].data[i],group:t.series[o].name,color:t.colorScale(t.series[o].name),width:t.innerScale.bandwidth(),height:t.series[o].data[i]>0?t.yScale(0)-t.yScale(t.series[o].data[i]):t.yScale(t.series[o].data[i])-t.yScale(0),x:t.innerScale(t.series[o].name)+t.xScale(e),y:t.series[o].data[i]>0?t.yScale(t.series[o].data[i]):t.yScale(0),className:"vertical_bar"};t.bars.push(n)}})):this.categories.map((function(e,i){for(var o=0;o<t.series.length;o++){var n={value:e,data:t.series[o].data[i],group:t.series[o].name,color:t.colorScale(t.series[o].name),width:t.series[o].data[i]>0?t.xScale(t.series[o].data[i])-t.xScale(0):t.xScale(0)-t.xScale(t.series[o].data[i]),height:t.innerScale.bandwidth(),x:t.series[o].data[i]>0?t.xScale(0):t.xScale(t.series[o].data[i]),y:t.innerScale(t.series[o].name)+t.yScale(e),className:"horizontal_bar"};t.bars.push(n)}}))},t.prototype.yAxisWidthChange=function(t){var e=t.yAxisWidth,i=t.yAxisHeight;t.yAxisRightWidth;this.options=s({},this.options,{yAxis:s({},this.options.yAxis,{width:e,height:i})}),this.update()},t.prototype.xAxisHeightChange=function(t){var e=t.xAxisHeight;this.options=s({},this.options,{xAxis:s({},this.options.xAxis,{height:e})}),this.update()},t.prototype.headerHeightChange=function(t){var e=t.headerHeight;this.options=s({},this.options,{header:s({},this.options.header,{height:e})}),this.update()},t.prototype.toolTipPlaccement=function(t){return"vertical"==this.options.barType?t>0?"top":"bottom":t>0?"right":"left"},t.prototype.onResize=function(t){var e=this;setTimeout((function(){return e.update()}))},t.prototype.getViewBox=function(){return this.options.width>0&&this.options.height>0?"0 0 "+this.options.width+" "+this.options.height:"0 0 0 0"},t.prototype.strToNumber=function(t){var e=t.match(/\d+/g).join("");return parseFloat(e)},t.decorators=[{type:e.Component,args:[{selector:"ngx-charts-bar",template:'<div [style.width]="options.width+\'px\'" [style.border]="\'1px solid #f3f3f3\'">\r\n\r\n    <svg version="1.1" class="highcharts-root" [attr.padding]="options.padding" [attr.width]="options.width"\r\n        [attr.height]="options.height" [attr.viewBox]="getViewBox()"\r\n        aria-label="Interactive chart" [style.border]="\'0px solid gray\'" [style.padding]="options.padding"\r\n        aria-hidden="false">\r\n\r\n        <g header [options]="options" (headerHeightChange)="headerHeightChange($event)"></g>\r\n\r\n        <g y-axis \r\n            [xScale]="xScale" \r\n            [yScale]="yScale" \r\n            [options]="options" \r\n            [categories]="categories" \r\n            [series]="series"\r\n            (yAxisWidthChange)="yAxisWidthChange($event)"></g>\r\n\r\n        <g x-axis \r\n            [xScale]="xScale" \r\n            [yScale]="yScale" \r\n            [options]="options" \r\n            [categories]="categories" \r\n            [series]="series"\r\n            (xAxisHeightChange)="xAxisHeightChange($event)"></g>\r\n\r\n        <g data-z-index="0.1" >\r\n            <rect *ngFor="let bar of bars" \r\n                [attr.class]="bar.className"\r\n                [attr.x]="bar.x+this.options.yAxis.width"\r\n                [tooltip]="bar.value+\', \'+bar.group+\', \'+bar.data" \r\n                [placement]="toolTipPlaccement(bar.data)" \r\n                [tooltipColor]="bar.color" \r\n                delay="10"\r\n                [attr.y]="bar.y+this.options.header.height" \r\n                [attr.width]="bar.width" [attr.height]="bar.height"\r\n                [attr.fill]="bar.color" opacity="1"  tabindex="-1" role="img"\r\n                aria-label="1. Jan, 49.9. Tokyo."></rect>\r\n        </g>\r\n    </svg>\r\n    <chart-legend\r\n        *ngIf="groupName.length"\r\n        [groupName]="groupName"\r\n        [options]="options"\r\n        [series] = "series"    \r\n    >\r\n    </chart-legend>\r\n  \r\n</div>\r\n\r\n',encapsulation:e.ViewEncapsulation.None,styles:['.tooltip-example{text-align:center;padding:0 50px}.tooltip-example [tooltip]{display:inline-block;margin:50px 20px;width:180px;height:50px;border:1px solid gray;border-radius:5px;line-height:50px;text-align:center}.ng-tooltip{position:absolute;max-width:150px;font-size:14px;text-align:center;color:#fafae3;padding:3px 8px;background:#282a36;border-radius:4px;z-index:1000;opacity:0}.ng-tooltip:after{content:"";position:absolute;border-style:solid}.ng-tooltip-top:after{top:100%;left:50%;margin-left:-5px;border-width:5px;border-color:#000 transparent transparent}.ng-tooltip-bottom:after{bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-color:transparent transparent #000}.ng-tooltip-left:after{top:50%;left:100%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #000}.ng-tooltip-right:after{top:50%;right:100%;margin-top:-5px;border-width:5px;border-color:transparent #000 transparent transparent}.ng-tooltip-show{opacity:1}.horizontal_bar{-webkit-animation:1s linear forwards horizontal_bar_frames;animation:1s linear forwards horizontal_bar_frames}@-webkit-keyframes horizontal_bar_frames{from{width:0}}@keyframes horizontal_bar_frames{from{width:0}}.vertical_bar{-webkit-animation:1s linear forwards vertical_bar_frames;animation:1s linear forwards vertical_bar_frames}@-webkit-keyframes vertical_bar_frames{from{height:0}}@keyframes vertical_bar_frames{from{height:0}}']}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ElementRef},{type:e.ChangeDetectorRef}]},t.propDecorators={options:[{type:e.Input}],categories:[{type:e.Input}],series:[{type:e.Input}],onResize:[{type:e.HostListener,args:["window:resize",["$event"]]}]},t}();var w=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[b],imports:[i.CommonModule,d,g,x,f],exports:[b],providers:[]}]}],t}(),v=function(){function t(t,e,i){this.chartElement=e,this.cdr=i,this.customOptions={barType:"vertical",title:"",subtitle:"",height:0,width:0,padding:5,xAxis:{title:"",height:0,labelRotation:0,labelAlign:"left",labelEllipsis:!1,labelEllipsisSize:16},yAxis:{title:"",width:0,height:0,labelRotation:0,labelEllipsis:!1,labelEllipsisSize:16},legend:{labelEllipsis:!1,labelEllipsisSize:16},plotBackground:{x:0,y:0,height:0,width:0},plotOptions:{groupBarPadding:20,innerBarPadding:3},header:{height:0,width:0}},this._options={},this._series=[],this.categories=[],this.bars=[],this.groupName=[],this.element=t.nativeElement,this.trimLabel=l}return Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(t){var e=t.xAxis;e.labelEllipsis=null!=t.xAxis.labelEllipsisSize&&t.xAxis.labelEllipsisSize>0;var i=t.yAxis;i.labelEllipsis=null!=t.yAxis.labelEllipsisSize&&t.yAxis.labelEllipsisSize>0;var o=t.legend;o.labelEllipsis=null!=t.legend.labelEllipsisSize&&t.legend.labelEllipsisSize>0;var n=t.plotBackground,r=t.plotOptions,a=t.header;delete t.xAxis,delete t.yAxis,delete t.legend,delete t.plotBackground,delete t.plotOptions,delete t.header,this._options=s({},this.customOptions,t,{xAxis:s({},this.customOptions.xAxis,e),yAxis:s({},this.customOptions.yAxis,i),legend:s({},this.customOptions.legend,o),plotBackground:s({},this.customOptions.plotBackground,n),plotOptions:s({},this.customOptions.plotOptions,r),header:s({},this.customOptions.header,a)})},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"series",{get:function(){return this._series},set:function(t){this._series=t;for(var e=0;e<t.length;e++)for(var i=0;i<t[e].data.length;i++)this._series[e].data[i]=this._series[e].data[i]<0?0:this._series[e].data[i]},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){var e=this;this.groupBarPaddingBK=this.options.plotOptions.groupBarPadding,this.innerBarPaddingBK=this.options.plotOptions.innerBarPadding,setTimeout((function(){return e.update()}))},t.prototype.ngOnInit=function(){this.options.width=this.options.width,this.options.height=this.options.height,this.update()},t.prototype.update=function(){var t=this,e=this.chartElement.nativeElement,i=null!==e.parentNode?e.parentNode.getBoundingClientRect():{height:400,width:800},o=e.parentNode.currentStyle||window.getComputedStyle(e.parentNode);this.options.height=this.options.height?this.options.height:i.height-this.strToNumber(o.paddingLeft)-this.strToNumber(o.paddingRight),this.options.width=(this.options.width,i.width-this.strToNumber(o.paddingLeft)-this.strToNumber(o.paddingRight)),this.calPlotBackground();var n=!1;this.options.plotOptions.groupBarPadding=this.groupBarPaddingBK,this.options.plotOptions.innerBarPadding=this.innerBarPaddingBK;do{1==n&&(this.options.plotOptions.groupBarPadding--,this.options.plotOptions.innerBarPadding=2),"vertical"==this.options.barType?this.xScale=this.getXScale():this.yScale=this.getXScale(),this.innerScale=this.getInnerScale(),n=!0}while(this.innerScale.bandwidth()<2);"vertical"==this.options.barType?this.yScale=this.getYScale():this.xScale=this.getYScale();var s=new m(this.options,this.series);this.colorScale=s.generateColorScale(),setTimeout((function(){t.groupName=[],t.series.map((function(e){e.name&&t.groupName.push({name:e.name,color:t.colorScale(e.name)})})),t.createBar()})),this.cdr.detectChanges()},t.prototype.getXScale=function(){var t,e;if("vertical"==this.options.barType)t=this.categories.length/(this.options.plotBackground.width/this.options.plotOptions.groupBarPadding),e=[0,this.options.plotBackground.width];else{this.options.height,this.options.header.height;t=this.categories.length/(this.options.plotBackground.height/this.options.plotOptions.groupBarPadding),e=[0,this.options.plotBackground.height]}return o.scaleBand().range(e).paddingInner(t).paddingOuter(.1).domain(this.categories)},t.prototype.getInnerScale=function(){var t,e;return"vertical"==this.options.barType?(t=this.series.length/(this.xScale.bandwidth()/this.options.plotOptions.innerBarPadding),e=this.xScale.bandwidth()):(t=this.series.length/(this.yScale.bandwidth()/this.options.plotOptions.innerBarPadding),e=this.yScale.bandwidth()),o.scaleBand().range([0,e]).paddingInner(t).domain(["All"])},t.prototype.getYScale=function(){var t=new Set;if(0!=this.series.length)for(var e=0;e<this.series[0].data.length;e++){for(var i=0,n=0;n<this.series.length;n++)i+=this.series[n].data[e];t.add(i)}var s=Math.min.apply(Math,a(t));s=s>0?0:s;var r=Math.max.apply(Math,a([0],t));r=r>0?r:0;var l=[];"vertical"==this.options.barType?l=[this.options.plotBackground.height,0]:l=[0,this.options.plotBackground.width-30];return o.scaleLinear().range(l).domain([s,r])},t.prototype.calPlotBackground=function(){this.options=s({},this.options,{plotBackground:s({},this.options.plotBackground,{x:0,y:0,height:this.options.height-this.options.xAxis.height-this.options.header.height-this.options.padding,width:this.options.width-this.options.yAxis.width-this.options.padding})})},t.prototype.createBar=function(){var t=this;this.bars=[],"vertical"==this.options.barType?this.categories.map((function(e,i){for(var o=0,n=0;n<t.series.length;n++){var s={value:e,data:t.series[n].data[i],group:t.series[n].name,color:t.colorScale(t.series[n].name),width:t.innerScale.bandwidth(),height:t.series[n].data[i]>0?t.yScale(0)-t.yScale(t.series[n].data[i]):t.yScale(t.series[n].data[i])-t.yScale(0),x:t.innerScale("All")+t.xScale(e),className:"vertical_bar"};s.y=0==n?t.series[n].data[i]>0?t.yScale(t.series[n].data[i]):t.yScale(0):o-s.height,o=s.y,t.bars.push(s)}})):this.categories.map((function(e,i){for(var o=0,n=0;n<t.series.length;n++){var s={value:e,data:t.series[n].data[i],group:t.series[n].name,color:t.colorScale(t.series[n].name),width:t.series[n].data[i]>0?t.xScale(t.series[n].data[i])-t.xScale(0):t.xScale(0)-t.xScale(t.series[n].data[i]),height:t.innerScale.bandwidth(),y:t.innerScale("All")+t.yScale(e),className:"horizontal_bar"};s.x=0==n?t.series[n].data[i]>0?t.xScale(0):t.xScale(t.series[n].data[i]):o,o=s.x+s.width,t.bars.push(s)}}))},t.prototype.yAxisWidthChange=function(t){var e=t.yAxisWidth,i=t.yAxisHeight;t.yAxisRightWidth;this.options=s({},this.options,{yAxis:s({},this.options.yAxis,{width:e,height:i})}),this.update()},t.prototype.xAxisHeightChange=function(t){var e=t.xAxisHeight;this.options=s({},this.options,{xAxis:s({},this.options.xAxis,{height:e})}),this.update()},t.prototype.headerHeightChange=function(t){var e=t.headerHeight;this.options=s({},this.options,{header:s({},this.options.header,{height:e})}),this.update()},t.prototype.toolTipPlaccement=function(t){return"vertical"==this.options.barType?t>0?"top":"bottom":t>0?"right":"left"},t.prototype.onResize=function(t){var e=this;setTimeout((function(){return e.update()}))},t.prototype.getViewBox=function(){return this.options.width>0&&this.options.height>0?"0 0 "+this.options.width+" "+this.options.height:"0 0 0 0"},t.prototype.strToNumber=function(t){var e=t.match(/\d+/g).join("");return parseFloat(e)},t.decorators=[{type:e.Component,args:[{selector:"ngx-charts-stacked",template:'<div [style.width]="options.width+\'px\'" [style.border]="\'1px solid #f3f3f3\'">\r\n\r\n    <svg version="1.1" class="highcharts-root" [attr.padding]="options.padding" [attr.width]="options.width"\r\n        [attr.height]="options.height" [attr.viewBox]="getViewBox()"\r\n        aria-label="Interactive chart" [style.border]="\'0px solid gray\'" [style.padding]="options.padding"\r\n        aria-hidden="false">\r\n\r\n        <g header [options]="options" (headerHeightChange)="headerHeightChange($event)"></g>\r\n\r\n        <g y-axis \r\n            [xScale]="xScale" \r\n            [yScale]="yScale" \r\n            [options]="options" \r\n            [categories]="categories" \r\n            [series]="series"\r\n            (yAxisWidthChange)="yAxisWidthChange($event)"></g>\r\n\r\n        <g x-axis \r\n            [xScale]="xScale" \r\n            [yScale]="yScale" \r\n            [options]="options" \r\n            [categories]="categories" \r\n            [series]="series"\r\n            (xAxisHeightChange)="xAxisHeightChange($event)"></g>\r\n\r\n        <g data-z-index="0.1" >\r\n            <rect *ngFor="let bar of bars" \r\n                [attr.class]="bar.className"\r\n                [attr.x]="bar.x+this.options.yAxis.width"\r\n                [tooltip]="bar.value+\', \'+bar.group+\', \'+bar.data" \r\n                [tooltipColor]="bar.color" \r\n                [placement]="toolTipPlaccement(bar.data)" \r\n                delay="10"\r\n                [attr.y]="bar.y+this.options.header.height" \r\n                [attr.width]="bar.width" [attr.height]="bar.height"\r\n                [attr.fill]="bar.color" opacity="1"  tabindex="-1" role="img"\r\n                aria-label="1. Jan, 49.9. Tokyo."></rect>\r\n        </g>\r\n    </svg>\r\n    <chart-legend\r\n        *ngIf="groupName.length"\r\n        [groupName]="groupName"\r\n        [options]="options"\r\n        [series] = "series"    \r\n    >\r\n    </chart-legend>\r\n  \r\n</div>\r\n\r\n',encapsulation:e.ViewEncapsulation.None,styles:['.tooltip-example{text-align:center;padding:0 50px}.tooltip-example [tooltip]{display:inline-block;margin:50px 20px;width:180px;height:50px;border:1px solid gray;border-radius:5px;line-height:50px;text-align:center}.ng-tooltip{position:absolute;max-width:150px;font-size:14px;text-align:center;color:#fafae3;padding:3px 8px;background:#282a36;border-radius:4px;z-index:1000;opacity:0}.ng-tooltip:after{content:"";position:absolute;border-style:solid}.ng-tooltip-top:after{top:100%;left:50%;margin-left:-5px;border-width:5px;border-color:#000 transparent transparent}.ng-tooltip-bottom:after{bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-color:transparent transparent #000}.ng-tooltip-left:after{top:50%;left:100%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #000}.ng-tooltip-right:after{top:50%;right:100%;margin-top:-5px;border-width:5px;border-color:transparent #000 transparent transparent}.ng-tooltip-show{opacity:1}.horizontal_bar{-webkit-animation:1s linear forwards horizontal_bar_frames;animation:1s linear forwards horizontal_bar_frames}@-webkit-keyframes horizontal_bar_frames{from{width:0}}@keyframes horizontal_bar_frames{from{width:0}}.vertical_bar{-webkit-animation:1s linear forwards vertical_bar_frames;animation:1s linear forwards vertical_bar_frames}@-webkit-keyframes vertical_bar_frames{from{height:0}}@keyframes vertical_bar_frames{from{height:0}}']}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ElementRef},{type:e.ChangeDetectorRef}]},t.propDecorators={options:[{type:e.Input}],categories:[{type:e.Input}],series:[{type:e.Input}],onResize:[{type:e.HostListener,args:["window:resize",["$event"]]}]},t}();var S=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[v],imports:[i.CommonModule,d,g,x,f],exports:[v],providers:[]}]}],t}(),A=function(){function t(t,e){this.chartElement=t,this.cdr=e,this.customOptions={barType:"vertical",title:"",subtitle:"",height:0,width:0,padding:5,xAxis:{title:"",height:0,labelRotation:0,labelAlign:"left",labelEllipsis:!1,labelEllipsisSize:16},yAxis:{title:"",width:0,height:0,labelRotation:0,labelEllipsis:!1,labelEllipsisSize:16},legend:{labelEllipsis:!1,labelEllipsisSize:16},plotBackground:{x:0,y:0,height:0,width:0},plotOptions:{groupBarPadding:20,innerBarPadding:3},header:{height:0,width:0}},this._options={},this.categories=[],this.series=[],this.lines=[],this.lineCircle=[],this.groupName=[]}return Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(t){var e=t.xAxis;e.labelEllipsis=null!=t.xAxis.labelEllipsisSize&&t.xAxis.labelEllipsisSize>0;var i=t.yAxis;i.labelEllipsis=null!=t.yAxis.labelEllipsisSize&&t.yAxis.labelEllipsisSize>0;var o=t.legend;o.labelEllipsis=null!=t.legend.labelEllipsisSize&&t.legend.labelEllipsisSize>0;var n=t.plotBackground,r=t.plotOptions,a=t.header;delete t.xAxis,delete t.yAxis,delete t.legend,delete t.plotBackground,delete t.plotOptions,delete t.header,this._options=s({},this.customOptions,t,{xAxis:s({},this.customOptions.xAxis,e),yAxis:s({},this.customOptions.yAxis,i),legend:s({},this.customOptions.legend,o),plotBackground:s({},this.customOptions.plotBackground,n),plotOptions:s({},this.customOptions.plotOptions,r),header:s({},this.customOptions.header,a)}),this._options.barType="vertical"},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){var e=this;this.groupBarPaddingBK=this.options.plotOptions.groupBarPadding,this.innerBarPaddingBK=this.options.plotOptions.innerBarPadding,setTimeout((function(){return e.update()}))},t.prototype.ngOnInit=function(){this.options.width=this.options.width,this.options.height=this.options.height,this.update()},t.prototype.update=function(){var t=this,e=this.chartElement.nativeElement,i=null!==e.parentNode?e.parentNode.getBoundingClientRect():{height:400,width:800},o=e.parentNode.currentStyle||window.getComputedStyle(e.parentNode);this.options.height=this.options.height?this.options.height:i.height-this.strToNumber(o.paddingLeft)-this.strToNumber(o.paddingRight),this.options.width=(this.options.width,i.width-this.strToNumber(o.paddingLeft)-this.strToNumber(o.paddingRight)),this.calPlotBackground();var n=!1;this.options.plotOptions.groupBarPadding=this.groupBarPaddingBK,this.options.plotOptions.innerBarPadding=this.innerBarPaddingBK;do{1==n&&(this.options.plotOptions.groupBarPadding--,this.options.plotOptions.innerBarPadding=2),"vertical"==this.options.barType?this.xScale=this.getXScale():this.yScale=this.getXScale(),this.innerScale=this.getInnerScale(),n=!0}while(this.innerScale.bandwidth()<2);"vertical"==this.options.barType?this.yScale=this.getYScale():this.xScale=this.getYScale();var s=new m(this.options,this.series);this.colorScale=s.generateColorScale(),setTimeout((function(){t.groupName=[],t.series.map((function(e){e.name&&t.groupName.push({name:e.name,color:t.colorScale(e.name)})})),t.createLine()})),this.cdr.detectChanges()},t.prototype.getXScale=function(){var t,e;if("vertical"==this.options.barType)t=this.categories.length/(this.options.plotBackground.width/this.options.plotOptions.groupBarPadding),e=[0,this.options.plotBackground.width];else{this.options.height,this.options.header.height;t=this.categories.length/(this.options.plotBackground.height/this.options.plotOptions.groupBarPadding),e=[0,this.options.plotBackground.height]}return o.scaleBand().range(e).paddingInner(t).paddingOuter(.1).domain(this.categories)},t.prototype.getInnerScale=function(){for(var t,e,i=[],n=0;n<this.series.length;n++)i.push(this.series[n].name);return"vertical"==this.options.barType?(t=this.series.length/(this.xScale.bandwidth()/this.options.plotOptions.innerBarPadding),e=this.xScale.bandwidth()):(t=this.series.length/(this.yScale.bandwidth()/this.options.plotOptions.innerBarPadding),e=this.yScale.bandwidth()),o.scaleBand().range([0,e]).paddingInner(t).domain(i)},t.prototype.getYScale=function(){var t=new Set;this.series.map((function(e){e.data.map((function(e){t.add(e)}))}));var e=Math.min.apply(Math,a(t));e=e>0?0:e;var i=Math.max.apply(Math,a([0],t));i=i>0?i:0;var n=[];"vertical"==this.options.barType?n=[this.options.plotBackground.height,0]:n=[0,this.options.plotBackground.width-30];return o.scaleLinear().range(n).domain([e,i])},t.prototype.calPlotBackground=function(){this.options=s({},this.options,{plotBackground:s({},this.options.plotBackground,{x:0,y:0,height:this.options.height-this.options.xAxis.height-this.options.header.height-this.options.padding,width:this.options.width-this.options.yAxis.width-this.options.padding})})},t.prototype.createLine=function(){this.lines=[],this.lineCircle=[];for(var t=0;t<this.series.length;t++){for(var e={points:"",color:""},i=0;i<this.categories.length;i++){var o=this.xScale(this.categories[i])+this.xScale.bandwidth()/2+this.options.yAxis.width,n=this.yScale(this.series[t].data[i])+this.options.header.height;e.points+=o+","+n+" ",e.color=this.colorScale(this.series[t].name),this.lineCircle.push({x:o,y:n,color:this.colorScale(this.series[t].name),value:this.categories[i],data:this.series[t].data[i],group:this.series[t].name})}this.lines.push(e)}},t.prototype.yAxisWidthChange=function(t){var e=t.yAxisWidth,i=t.yAxisHeight;this.options=s({},this.options,{yAxis:s({},this.options.yAxis,{width:e,height:i})}),this.update()},t.prototype.xAxisHeightChange=function(t){var e=t.xAxisHeight;this.options=s({},this.options,{xAxis:s({},this.options.xAxis,{height:e})}),this.update()},t.prototype.headerHeightChange=function(t){var e=t.headerHeight;this.options=s({},this.options,{header:s({},this.options.header,{height:e})}),this.update()},t.prototype.toolTipPlaccement=function(t){return"vertical"==this.options.barType?t>0?"top":"bottom":t>0?"right":"left"},t.prototype.onResize=function(t){var e=this;setTimeout((function(){return e.update()}))},t.prototype.strToNumber=function(t){var e=t.match(/\d+/g).join("");return parseFloat(e)},t.decorators=[{type:e.Component,args:[{selector:"ngx-charts-line",template:'<div [style.width]="options.width+\'px\'" [style.border]="\'1px solid #f3f3f3\'">\r\n    \r\n    <svg version="1.1" class="highcharts-root" [attr.padding]="options.padding" [attr.width]="options.width"\r\n        [attr.height]="options.height" [attr.viewBox]="\'0 0 \'+options.width +\' \'+ options.height"\r\n        aria-label="Interactive chart" [style.border]="\'0px solid gray\'" [style.padding]="options.padding"\r\n        aria-hidden="false">\r\n\r\n        <g header [options]="options" (headerHeightChange)="headerHeightChange($event)"></g>\r\n\r\n        <g y-axis \r\n            [xScale]="xScale" \r\n            [yScale]="yScale" \r\n            [options]="options" \r\n            [categories]="categories" \r\n            [series]="series"\r\n            (yAxisWidthChange)="yAxisWidthChange($event)"></g>\r\n\r\n        <g x-axis \r\n            [xScale]="xScale" \r\n            [yScale]="yScale" \r\n            [options]="options" \r\n            [categories]="categories" \r\n            [series]="series"\r\n            (xAxisHeightChange)="xAxisHeightChange($event)"></g>\r\n\r\n        <g data-z-index="0.1">\r\n            <polyline  \r\n                class="line"\r\n                *ngFor="let line of lines" \r\n                [attr.points]="line.points"\r\n                [style.fill]="\'none\'"\r\n                [style.stroke]="line.color"\r\n                [style.stroke-width]="3" >\r\n            </polyline>\r\n            <circle \r\n                *ngFor="let lc of lineCircle"\r\n                [tooltip]="lc.value+\', \'+lc.group+\', \'+lc.data" \r\n                [tooltipColor]="lc.color"\r\n                [placement]="toolTipPlaccement(lc.data)" \r\n                [attr.cx]="lc.x" \r\n                [attr.cy]="lc.y" \r\n                [attr.r]="3" \r\n                [attr.stroke]="lc.color" \r\n                [attr.stroke-width]="3" \r\n                [attr.fill]="lc.color">\r\n            </circle>\r\n        </g>\r\n\r\n    </svg>\r\n    <chart-legend\r\n        *ngIf="groupName.length"\r\n        [groupName]="groupName"\r\n        [options]="options"\r\n        [series] = "series"    \r\n    >\r\n    </chart-legend>\r\n  \r\n</div>\r\n\r\n',encapsulation:e.ViewEncapsulation.None,styles:['.tooltip-example{text-align:center;padding:0 50px}.tooltip-example [tooltip]{display:inline-block;margin:50px 20px;width:180px;height:50px;border:1px solid gray;border-radius:5px;line-height:50px;text-align:center}.ng-tooltip{position:absolute;max-width:150px;font-size:14px;text-align:center;color:#fafae3;padding:3px 8px;background:#282a36;border-radius:4px;z-index:1000;opacity:0}.ng-tooltip:after{content:"";position:absolute;border-style:solid}.ng-tooltip-top:after{top:100%;left:50%;margin-left:-5px;border-width:5px;border-color:#000 transparent transparent}.ng-tooltip-bottom:after{bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-color:transparent transparent #000}.ng-tooltip-left:after{top:50%;left:100%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #000}.ng-tooltip-right:after{top:50%;right:100%;margin-top:-5px;border-width:5px;border-color:transparent #000 transparent transparent}.ng-tooltip-show{opacity:1}.line{stroke-dasharray:2000;stroke-dashoffset:2000;-webkit-animation:2s linear forwards line_frames;animation:2s linear forwards line_frames}@-webkit-keyframes line_frames{to{stroke-dashoffset:0}}@keyframes line_frames{to{stroke-dashoffset:0}}']}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef}]},t.propDecorators={options:[{type:e.Input}],categories:[{type:e.Input}],series:[{type:e.Input}],onResize:[{type:e.HostListener,args:["window:resize",["$event"]]}]},t}();var B=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[A],imports:[i.CommonModule,d,g,x,f],exports:[A],providers:[]}]}],t}(),k=function(){function t(t,e){this.chartElement=t,this.cdr=e,this.customOptions={barType:"vertical",title:"",subtitle:"",height:0,width:0,padding:5,xAxis:{title:"",height:0,labelRotation:0,labelAlign:"left",labelEllipsis:!1,labelEllipsisSize:16},yAxis:{title:"",width:0,height:0,labelRotation:0,labelEllipsis:!1,labelEllipsisSize:16},plotBackground:{x:0,y:0,height:0,width:0},legend:{labelEllipsis:!1,labelEllipsisSize:16},plotOptions:{outerRadius:80,innerRadius:0,labelEllipsis:!1,labelEllipsisSize:16},header:{height:0,width:0}},this._options={},this.categories=[],this.series=[],this.pies=[],this.lineCircle=[],this.groupName=[],this.translation="",this.trimLabel=l}return Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(t){var e=t.xAxis,i=t.yAxis,o=t.legend;o.labelEllipsis=null!=t.legend.labelEllipsisSize&&t.legend.labelEllipsisSize>0;var n=t.plotBackground,r=t.plotOptions;r.labelEllipsis=null!=t.plotOptions.labelEllipsisSize&&t.plotOptions.labelEllipsisSize>0;var a=t.header;delete t.xAxis,delete t.yAxis,delete t.legend,delete t.plotBackground,delete t.plotOptions,delete t.header,this._options=s({},this.customOptions,t,{xAxis:s({},this.customOptions.xAxis,e),yAxis:s({},this.customOptions.yAxis,i),legend:s({},this.customOptions.legend,o),plotBackground:s({},this.customOptions.plotBackground,n),plotOptions:s({},this.customOptions.plotOptions,r),header:s({},this.customOptions.header,a)})},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){var e=this;setTimeout((function(){return e.update()}))},t.prototype.ngOnInit=function(){this.options.width=this.options.width,this.options.height=this.options.height,this.update()},t.prototype.update=function(){var t=this,e=this.chartElement.nativeElement,i=null!==e.parentNode?e.parentNode.getBoundingClientRect():{height:400,width:800},o=e.parentNode.currentStyle||window.getComputedStyle(e.parentNode);this.options.height=this.options.height?this.options.height:i.height-this.strToNumber(o.paddingLeft)-this.strToNumber(o.paddingRight),this.options.width=(this.options.width,i.width-this.strToNumber(o.paddingLeft)-this.strToNumber(o.paddingRight)),this.calPlotBackground();var n=this.options.width/2,s=this.options.header.height+this.options.plotBackground.height/2;this.translation="translate("+n+", "+s+")",this.calcArc=this.calculateArc(),this.pieGenerator=this.pieGeneratorFunc();var r=new m(this.options,this.series);this.colorScale=r.generateColorScale(),setTimeout((function(){t.groupName=[],t.series.map((function(e){e.name&&t.groupName.push({name:e.name,color:t.colorScale(e.name)})})),t.createPie()})),this.cdr.detectChanges()},t.prototype.pieGeneratorFunc=function(){return n.pie().value((function(t){return t.data})).sort(null)(this.series)},t.prototype.calculateArc=function(){var t=this.options.plotOptions.outerRadius,e=this.options.plotOptions.innerRadius;return n.arc().innerRadius(e).outerRadius(t).cornerRadius(0)},t.prototype.outerArc=function(){var t=this.options.plotOptions.outerRadius;return n.arc().innerRadius(1.2*t).outerRadius(1.2*t)},t.prototype.calPlotBackground=function(){this.options=s({},this.options,{plotBackground:s({},this.options.plotBackground,{x:0,y:0,height:this.options.height-this.options.xAxis.height-this.options.header.height-this.options.padding,width:this.options.width-this.options.yAxis.width-this.options.padding})})},t.prototype.createPie=function(){this.pies=[];for(var t=0;t<this.pieGenerator.length;t++){var e={path:this.calcArc.startAngle(this.pieGenerator[t].startAngle).endAngle(this.pieGenerator[t].endAngle)(),color:this.colorScale(this.pieGenerator[t].data.name),data:this.pieGenerator[t].data,pos:this.outerArc().centroid(this.pieGenerator[t]),labelPath:"",textAnchor:this.midAngle(this.pieGenerator[t])<Math.PI?"start":"end"};e.pos[0]=1.2*this.options.plotOptions.outerRadius*(this.midAngle(this.pieGenerator[t])<Math.PI?1:-1);var i=this.calcArc.centroid(this.pieGenerator[t]),o=e.pos[1]/i[1];0!==e.pos[1]&&0!==i[1]||(o=1);var n=[o*i[0],o*i[1]];e.labelPath="M"+i+"L"+n+"L"+e.pos,this.pies.push(e)}},t.prototype.midAngle=function(t){return t.startAngle+(t.endAngle-t.startAngle)/2},t.prototype.yAxisWidthChange=function(t){var e=t.yAxisWidth,i=t.yAxisHeight;this.options=s({},this.options,{yAxis:s({},this.options.yAxis,{width:e,height:i})}),this.update()},t.prototype.xAxisHeightChange=function(t){var e=t.xAxisHeight;this.options=s({},this.options,{xAxis:s({},this.options.xAxis,{height:e})}),this.update()},t.prototype.headerHeightChange=function(t){var e=t.headerHeight;this.options=s({},this.options,{header:s({},this.options.header,{height:e})}),this.update()},t.prototype.toolTipPlaccement=function(t){return"vertical"==this.options.barType?t>0?"top":"bottom":t>0?"right":"left"},t.prototype.onResize=function(t){var e=this;setTimeout((function(){return e.update()}))},t.prototype.strToNumber=function(t){var e=t.match(/\d+/g).join("");return parseFloat(e)},t.decorators=[{type:e.Component,args:[{selector:"ngx-charts-pie",template:'<div [style.width]="options.width+\'px\'" [style.border]="\'1px solid #f3f3f3\'">\r\n\r\n    <svg version="1.1" class="highcharts-root" [attr.padding]="options.padding" [attr.width]="options.width"\r\n        [attr.height]="options.height" [attr.viewBox]="\'0 0 \'+options.width +\' \'+ options.height"\r\n        aria-label="Interactive chart" [style.border]="\'0px solid gray\'" [style.padding]="options.padding"\r\n        aria-hidden="false"  >\r\n\r\n        <g header [options]="options" (headerHeightChange)="headerHeightChange($event)"></g>\r\n        <g  \r\n            [attr.transform]="translation" \r\n            *ngFor="let pie of pies" >\r\n            <path  \r\n                class="pieSlice"\r\n                [attr.d]="pie.path"\r\n                [style.fill]="pie.color"\r\n                [tooltip]="pie.data.name+\', \'+pie.data.data" \r\n                [tooltipColor]="pie.color"\r\n                [placement]="toolTipPlaccement(pie.data.data)" \r\n            ></path>\r\n\r\n            \x3c!--label path  --\x3e\r\n            <path  \r\n                class="pie"\r\n                [attr.d]="pie.labelPath"\r\n                [style.stroke]="pie.color"\r\n                fill="none"\r\n            ></path>\r\n\r\n            <text\r\n                [attr.x]="pie.pos[0]" \r\n                [attr.y]="pie.pos[1]"\r\n                [style.textAnchor]="pie.textAnchor"\r\n                [style.shapeRendering]="\'crispEdges\'"\r\n            >\r\n                {{   options.plotOptions.labelEllipsis ? trimLabel(pie.data.name, options.plotOptions.labelEllipsisSize) :  pie.data.name}}\r\n            </text>\r\n\r\n        </g>\r\n    </svg>\r\n    <chart-legend\r\n        *ngIf="groupName.length"\r\n        [groupName]="groupName"\r\n        [options]="options"\r\n        [series] = "series"    \r\n    >\r\n    </chart-legend>\r\n  \r\n</div>\r\n\r\n',encapsulation:e.ViewEncapsulation.None,styles:['.tooltip-example{text-align:center;padding:0 50px}.tooltip-example [tooltip]{display:inline-block;margin:50px 20px;width:180px;height:50px;border:1px solid gray;border-radius:5px;line-height:50px;text-align:center}.ng-tooltip{position:absolute;max-width:150px;font-size:14px;text-align:center;color:#fafae3;padding:3px 8px;background:#282a36;border-radius:4px;z-index:1000;opacity:0}.ng-tooltip:after{content:"";position:absolute;border-style:solid}.ng-tooltip-top:after{top:100%;left:50%;margin-left:-5px;border-width:5px;border-color:#000 transparent transparent}.ng-tooltip-bottom:after{bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-color:transparent transparent #000}.ng-tooltip-left:after{top:50%;left:100%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #000}.ng-tooltip-right:after{top:50%;right:100%;margin-top:-5px;border-width:5px;border-color:transparent #000 transparent transparent}.ng-tooltip-show{opacity:1}.pie{stroke-dasharray:2000;stroke-dashoffset:2000;-webkit-animation:1s linear 1.3s forwards pie_frames;animation:1s linear 1.3s forwards pie_frames}@-webkit-keyframes pie_frames{to{stroke-dashoffset:0}}@keyframes pie_frames{to{stroke-dashoffset:0}}.pieSlice{-webkit-animation:1.5s forwards pieSlice_frames;animation:1.5s forwards pieSlice_frames}@-webkit-keyframes pieSlice_frames{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes pieSlice_frames{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}']}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef}]},t.propDecorators={options:[{type:e.Input}],categories:[{type:e.Input}],series:[{type:e.Input}],onResize:[{type:e.HostListener,args:["window:resize",["$event"]]}]},t}();var E=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[k],imports:[i.CommonModule,d,g,x,f],exports:[k],providers:[]}]}],t}(),O=function(){function t(t,e){this.chartElement=t,this.cdr=e,this.customOptions={barType:"vertical",title:"",subtitle:"",height:0,width:0,padding:5,xAxis:{title:"",height:0,labelRotation:0,labelAlign:"left",labelEllipsis:!1,labelEllipsisSize:16},yAxis:{title:"",rightTitle:"",width:0,rightWidth:0,height:0,labelRotation:0,labelEllipsis:!1,labelEllipsisSize:16},legend:{labelEllipsis:!1,labelEllipsisSize:16},plotBackground:{x:0,y:0,height:0,width:0},plotOptions:{groupBarPadding:20,innerBarPadding:3},header:{height:0,width:0}},this._options={},this.categories=[],this.series=[],this.lines=[],this.bars=[],this.lineCircle=[],this.groupName=[]}return Object.defineProperty(t.prototype,"options",{get:function(){return this._options},set:function(t){var e=t.xAxis;e.labelEllipsis=null!=t.xAxis.labelEllipsisSize&&t.xAxis.labelEllipsisSize>0;var i=t.yAxis;i.labelEllipsis=null!=t.yAxis.labelEllipsisSize&&t.yAxis.labelEllipsisSize>0,i.title=i.leftTitle;var o=t.legend;o.labelEllipsis=null!=t.legend.labelEllipsisSize&&t.legend.labelEllipsisSize>0;var n=t.plotBackground,r=t.plotOptions,a=t.header;delete t.xAxis,delete t.yAxis,delete t.legend,delete t.plotBackground,delete t.plotOptions,delete t.header,this._options=s({},this.customOptions,t,{xAxis:s({},this.customOptions.xAxis,e),yAxis:s({},this.customOptions.yAxis,i),legend:s({},this.customOptions.legend,o),plotBackground:s({},this.customOptions.plotBackground,n),plotOptions:s({},this.customOptions.plotOptions,r),header:s({},this.customOptions.header,a)}),this._options.barType="vertical"},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){var e=this;this.groupBarPaddingBK=this.options.plotOptions.groupBarPadding,this.innerBarPaddingBK=this.options.plotOptions.innerBarPadding,setTimeout((function(){return e.update()}))},t.prototype.ngOnInit=function(){this.options.width=this.options.width,this.options.height=this.options.height,this.update()},t.prototype.update=function(){var t=this,e=this.chartElement.nativeElement,i=null!==e.parentNode?e.parentNode.getBoundingClientRect():{height:400,width:800},o=e.parentNode.currentStyle||window.getComputedStyle(e.parentNode);this.options.height=this.options.height?this.options.height:i.height-this.strToNumber(o.paddingLeft)-this.strToNumber(o.paddingRight),this.options.width=(this.options.width,i.width-this.strToNumber(o.paddingLeft)-this.strToNumber(o.paddingRight)),this.calPlotBackground();var n=!1;this.options.plotOptions.groupBarPadding=this.groupBarPaddingBK,this.options.plotOptions.innerBarPadding=this.innerBarPaddingBK;do{1==n&&(this.options.plotOptions.groupBarPadding--,this.options.plotOptions.innerBarPadding=2),"vertical"==this.options.barType&&(this.xScale=this.getXScale()),this.innerScale=this.getInnerScale(),n=!0}while(this.innerScale.bandwidth()<2);"vertical"==this.options.barType&&(this.yScale=this.getYScale(),this.yRightScale=this.getYRightScale());var s=new m(this.options,this.series);this.colorScale=s.generateColorScale(),setTimeout((function(){t.groupName=[],t.series.map((function(e){e.name&&t.groupName.push({name:e.name,color:t.colorScale(e.name)})})),t.createBar(),t.createLine()})),this.cdr.detectChanges()},t.prototype.getXScale=function(){var t,e;return"vertical"==this.options.barType&&(t=this.categories.length/(this.options.plotBackground.width/this.options.plotOptions.groupBarPadding),e=[0,this.options.plotBackground.width]),o.scaleBand().range(e).paddingInner(t).paddingOuter(.1).domain(this.categories)},t.prototype.getInnerScale=function(){for(var t,e,i=[],n=0;n<this.series.length;n++)"verticalBar"==this.series[n].type&&i.push(this.series[n].name);var s=0;for(n=0;n<this.series.length;n++)"verticalBar"==this.series[n].type&&s++;return"vertical"==this.options.barType&&(t=s/(this.xScale.bandwidth()/this.options.plotOptions.innerBarPadding),e=this.xScale.bandwidth()),o.scaleBand().range([0,e]).paddingInner(t).domain(i)},t.prototype.getYScale=function(){var t=new Set;this.series.map((function(e){"verticalBar"==e.type&&e.data.map((function(e){t.add(e)}))}));var e=Math.min.apply(Math,a(t));e=e>0?0:e;var i=Math.max.apply(Math,a([0],t));i=i>0?i:0;var n=[];"vertical"==this.options.barType&&(n=[this.options.plotBackground.height,0]);return o.scaleLinear().range(n).domain([e,i])},t.prototype.getYRightScale=function(){var t=new Set;this.series.map((function(e){"line"!=e.type&&null!=e.type||e.data.map((function(e){t.add(e)}))}));var e=Math.min.apply(Math,a(t));e=e>0?0:e;var i=Math.max.apply(Math,a([0],t));i=i>0?i:0;var n=[];"vertical"==this.options.barType&&(n=[this.options.plotBackground.height,0]);return o.scaleLinear().range(n).domain([e,i])},t.prototype.calPlotBackground=function(){this.options=s({},this.options,{plotBackground:s({},this.options.plotBackground,{x:0,y:0,height:this.options.height-this.options.xAxis.height-this.options.header.height-this.options.padding,width:this.options.width-this.options.yAxis.width-this.options.padding-this.options.yAxis.rightWidth})})},t.prototype.createLine=function(){this.lines=[],this.lineCircle=[];for(var t=0;t<this.series.length;t++)if("line"==this.series[t].type||null==this.series[t].type){for(var e={points:"",color:""},i=0;i<this.categories.length;i++){var o=this.xScale(this.categories[i])+this.xScale.bandwidth()/2+this.options.yAxis.width,n=this.yRightScale(this.series[t].data[i])+this.options.header.height;e.points+=o+","+n+" ",e.color=this.colorScale(this.series[t].name),this.lineCircle.push({x:o,y:n,color:this.colorScale(this.series[t].name),value:this.categories[i],data:this.series[t].data[i],group:this.series[t].name})}this.lines.push(e)}},t.prototype.createBar=function(){var t=this;this.bars=[],this.categories.map((function(e,i){for(var o=0;o<t.series.length;o++)if("verticalBar"==t.series[o].type){var n={value:e,data:t.series[o].data[i],group:t.series[o].name,color:t.colorScale(t.series[o].name),width:t.innerScale.bandwidth(),height:t.series[o].data[i]>0?t.yScale(0)-t.yScale(t.series[o].data[i]):t.yScale(t.series[o].data[i])-t.yScale(0),x:t.innerScale(t.series[o].name)+t.xScale(e),y:t.series[o].data[i]>0?t.yScale(t.series[o].data[i]):t.yScale(0),className:"vertical_bar"};t.bars.push(n)}}))},t.prototype.yAxisWidthChange=function(t){var e=t.yAxisWidth,i=t.yAxisHeight,o=t.yAxisRightWidth;this.options=s({},this.options,{yAxis:s({},this.options.yAxis,{width:e,height:i,rightWidth:o})}),this.update()},t.prototype.xAxisHeightChange=function(t){var e=t.xAxisHeight;this.options=s({},this.options,{xAxis:s({},this.options.xAxis,{height:e})}),this.update()},t.prototype.headerHeightChange=function(t){var e=t.headerHeight;this.options=s({},this.options,{header:s({},this.options.header,{height:e})}),this.update()},t.prototype.toolTipPlaccement=function(t){return"vertical"==this.options.barType?t>0?"top":"bottom":t>0?"right":"left"},t.prototype.onResize=function(t){var e=this;setTimeout((function(){return e.update()}))},t.prototype.strToNumber=function(t){var e=t.match(/\d+/g).join("");return parseFloat(e)},t.decorators=[{type:e.Component,args:[{selector:"ngx-charts-combo",template:'<div [style.width]="options.width+\'px\'" [style.border]="\'1px solid #f3f3f3\'">\r\n    \r\n    <svg version="1.1" class="highcharts-root" [attr.padding]="options.padding" [attr.width]="options.width"\r\n        [attr.height]="options.height" [attr.viewBox]="\'0 0 \'+options.width +\' \'+ options.height"\r\n        aria-label="Interactive chart" [style.border]="\'0px solid gray\'" [style.padding]="options.padding"\r\n        aria-hidden="false">\r\n\r\n        <g header [options]="options" (headerHeightChange)="headerHeightChange($event)"></g>\r\n\r\n        <g y-axis \r\n            [xScale]="xScale" \r\n            [yScale]="yScale" \r\n            [yRightScale]= "yRightScale"\r\n            [options]="options" \r\n            [categories]="categories" \r\n            [series]="series"\r\n            (yAxisWidthChange)="yAxisWidthChange($event)"></g>\r\n\r\n        <g x-axis \r\n            [xScale]="xScale" \r\n            [yScale]="yScale" \r\n            [options]="options" \r\n            [categories]="categories" \r\n            [series]="series"\r\n            (xAxisHeightChange)="xAxisHeightChange($event)"></g>\r\n            \r\n        <g data-z-index="0.1" >\r\n            <rect *ngFor="let bar of bars" \r\n                [attr.class]="bar.className"\r\n                [attr.x]="bar.x+this.options.yAxis.width"\r\n                [tooltip]="bar.value+\', \'+bar.group+\', \'+bar.data" \r\n                [tooltipColor]="bar.color"\r\n                [placement]="toolTipPlaccement(bar.data)" \r\n                delay="10"\r\n                [attr.y]="bar.y+this.options.header.height" \r\n                [attr.width]="bar.width" [attr.height]="bar.height"\r\n                [attr.fill]="bar.color" opacity="1"  tabindex="-1" role="img"\r\n                aria-label="1. Jan, 49.9. Tokyo."></rect>\r\n        </g>\r\n        <g data-z-index="0.1">\r\n            <polyline  \r\n                class="line"\r\n                *ngFor="let line of lines" \r\n                [attr.points]="line.points"\r\n                [style.fill]="\'none\'"\r\n                [style.stroke]="line.color"\r\n                [style.stroke-width]="3" >\r\n            </polyline>\r\n            <circle \r\n                *ngFor="let lc of lineCircle"\r\n                [tooltip]="lc.value+\', \'+lc.group+\', \'+lc.data" \r\n                [tooltipColor]="lc.color"\r\n                [placement]="toolTipPlaccement(lc.data)" \r\n                [attr.cx]="lc.x" \r\n                [attr.cy]="lc.y" \r\n                [attr.r]="3" \r\n                [attr.stroke]="lc.color" \r\n                [attr.stroke-width]="3" \r\n                [attr.fill]="lc.color">\r\n            </circle>\r\n        </g>\r\n\r\n    </svg>\r\n    <chart-legend\r\n        *ngIf="groupName.length"\r\n        [groupName]="groupName"\r\n        [options]="options"\r\n        [series] = "series"    \r\n    >\r\n    </chart-legend>\r\n  \r\n</div>\r\n\r\n',encapsulation:e.ViewEncapsulation.None,styles:['.tooltip-example{text-align:center;padding:0 50px}.tooltip-example [tooltip]{display:inline-block;margin:50px 20px;width:180px;height:50px;border:1px solid gray;border-radius:5px;line-height:50px;text-align:center}.ng-tooltip{position:absolute;max-width:150px;font-size:14px;text-align:center;color:#fafae3;padding:3px 8px;background:#282a36;border-radius:4px;z-index:1000;opacity:0}.ng-tooltip:after{content:"";position:absolute;border-style:solid}.ng-tooltip-top:after{top:100%;left:50%;margin-left:-5px;border-width:5px;border-color:#000 transparent transparent}.ng-tooltip-bottom:after{bottom:100%;left:50%;margin-left:-5px;border-width:5px;border-color:transparent transparent #000}.ng-tooltip-left:after{top:50%;left:100%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #000}.ng-tooltip-right:after{top:50%;right:100%;margin-top:-5px;border-width:5px;border-color:transparent #000 transparent transparent}.ng-tooltip-show{opacity:1}.line{stroke-dasharray:2000;stroke-dashoffset:2000;-webkit-animation:2s linear forwards line_frames;animation:2s linear forwards line_frames}@-webkit-keyframes line_frames{to{stroke-dashoffset:0}}@keyframes line_frames{to{stroke-dashoffset:0}}.vertical_bar{-webkit-animation:1s linear forwards vertical_bar_frames;animation:1s linear forwards vertical_bar_frames}@-webkit-keyframes vertical_bar_frames{from{height:0}}@keyframes vertical_bar_frames{from{height:0}}']}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:e.ChangeDetectorRef}]},t.propDecorators={options:[{type:e.Input}],categories:[{type:e.Input}],series:[{type:e.Input}],onResize:[{type:e.HostListener,args:["window:resize",["$event"]]}]},t}();var C=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{declarations:[O],imports:[i.CommonModule,d,g,x,f],exports:[O],providers:[]}]}],t}();t.ngxChartsBarModule=w,t.ngxChartsComboModule=C,t.ngxChartsLineModule=B,t.ngxChartsPieModule=E,t.ngxChartsStackedModule=S,t.ɵa=b,t.ɵb=d,t.ɵc=h,t.ɵd=p,t.ɵe=g,t.ɵf=c,t.ɵg=x,t.ɵh=u,t.ɵi=f,t.ɵj=y,t.ɵk=v,t.ɵl=A,t.ɵm=k,t.ɵn=O,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=tusharghoshbd-ngx-charts.umd.min.js.map