@tusharghoshbd/ngx-charts
Version:
Ngx charts is an angular library for presenting data in chart.
74 lines • 5.7 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { Component, Input } from '@angular/core';
import { trimLabel } from '../utils/trim-label.helper';
var LegendComponent = /** @class */ (function () {
function LegendComponent() {
this.trimLabel = trimLabel;
}
/**
* @param {?} changes
* @return {?}
*/
LegendComponent.prototype.ngOnChanges = /**
* @param {?} changes
* @return {?}
*/
function (changes) {
// console.log(changes)
this.update();
};
/**
* @return {?}
*/
LegendComponent.prototype.ngOnInit = /**
* @return {?}
*/
function () {
};
/**
* @return {?}
*/
LegendComponent.prototype.ngAfterViewInit = /**
* @return {?}
*/
function () {
};
/**
* @return {?}
*/
LegendComponent.prototype.update = /**
* @return {?}
*/
function () {
};
LegendComponent.decorators = [
{ type: 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}"]
}] }
];
/** @nocollapse */
LegendComponent.ctorParameters = function () { return []; };
LegendComponent.propDecorators = {
groupName: [{ type: Input }],
series: [{ type: Input }],
options: [{ type: Input }]
};
return LegendComponent;
}());
export { LegendComponent };
if (false) {
/** @type {?} */
LegendComponent.prototype.groupName;
/** @type {?} */
LegendComponent.prototype.series;
/** @type {?} */
LegendComponent.prototype.options;
/** @type {?} */
LegendComponent.prototype.trimLabel;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGVnZW5kLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0dXNoYXJnaG9zaGJkL25neC1jaGFydHMvIiwic291cmNlcyI6WyJsaWIvbGVnZW5kL2xlZ2VuZC5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQXFCLEtBQUssRUFBNEUsTUFBTSxlQUFlLENBQUM7QUFDOUksT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ3ZEO0lBV0k7UUFDSSxJQUFJLENBQUMsU0FBUyxHQUFDLFNBQVMsQ0FBQztJQUM3QixDQUFDOzs7OztJQUVELHFDQUFXOzs7O0lBQVgsVUFBWSxPQUFzQjtRQUM5Qix1QkFBdUI7UUFDdkIsSUFBSSxDQUFDLE1BQU0sRUFBRSxDQUFDO0lBQ2xCLENBQUM7Ozs7SUFFRCxrQ0FBUTs7O0lBQVI7SUFDQSxDQUFDOzs7O0lBRUQseUNBQWU7OztJQUFmO0lBQ0EsQ0FBQzs7OztJQUVELGdDQUFNOzs7SUFBT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