UNPKG

@progress/kendo-angular-charts

Version:

Kendo UI Charts for Angular - A comprehensive package for creating beautiful and interactive data visualization. Every chart type, stock charts, and sparklines are included.

93 lines (92 loc) 4.45 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Component, ContentChild, Input } from '@angular/core'; import { ConfigurationService } from '../common/configuration.service'; import { SettingsComponent } from '../common/settings.component'; import { TooltipTemplateService } from '../common/tooltip-template.service'; import { SeriesTooltipTemplateDirective } from './tooltip/series-tooltip-template.directive'; import { SharedTooltipTemplateDirective } from './tooltip/shared-tooltip-template.directive'; import * as i0 from "@angular/core"; import * as i1 from "../common/configuration.service"; import * as i2 from "../common/tooltip-template.service"; /** * The configuration options of the Chart series tooltip * ([see example]({% slug tooltips_chart_charts %})). */ export class TooltipComponent extends SettingsComponent { configurationService; templateService; background; border; color; /** * The font of the tooltip. * @default '12px sans-serif' */ font; format; /** * The opacity of the tooltip. * @default 1 */ opacity; padding; /** * If set to `true`, the Chart displays a single tooltip for every category. * @default false */ shared; /** * If set to `true`, the Chart displays the series tooltip. * @default false */ visible; seriesTooltipTemplate; sharedTooltipTemplate; constructor(configurationService, templateService) { super('tooltip', configurationService); this.configurationService = configurationService; this.templateService = templateService; this.markAsVisible(); } ngAfterContentChecked() { this.templateService.setTemplate(this.seriesTooltipTemplate ? this.seriesTooltipTemplate.templateRef : null); this.templateService.setSharedTemplate(this.sharedTooltipTemplate ? this.sharedTooltipTemplate.templateRef : null); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TooltipComponent, deps: [{ token: i1.ConfigurationService }, { token: i2.TooltipTemplateService }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TooltipComponent, isStandalone: true, selector: "kendo-chart-tooltip", inputs: { background: "background", border: "border", color: "color", font: "font", format: "format", opacity: "opacity", padding: "padding", shared: "shared", visible: "visible" }, queries: [{ propertyName: "seriesTooltipTemplate", first: true, predicate: SeriesTooltipTemplateDirective, descendants: true }, { propertyName: "sharedTooltipTemplate", first: true, predicate: SharedTooltipTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TooltipComponent, decorators: [{ type: Component, args: [{ selector: 'kendo-chart-tooltip', template: '', standalone: true }] }], ctorParameters: function () { return [{ type: i1.ConfigurationService }, { type: i2.TooltipTemplateService }]; }, propDecorators: { background: [{ type: Input }], border: [{ type: Input }], color: [{ type: Input }], font: [{ type: Input }], format: [{ type: Input }], opacity: [{ type: Input }], padding: [{ type: Input }], shared: [{ type: Input }], visible: [{ type: Input }], seriesTooltipTemplate: [{ type: ContentChild, args: [SeriesTooltipTemplateDirective, { static: false }] }], sharedTooltipTemplate: [{ type: ContentChild, args: [SharedTooltipTemplateDirective, { static: false }] }] } });