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.

70 lines (69 loc) 3.74 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { Directive, TemplateRef, Optional } from '@angular/core'; import * as i0 from "@angular/core"; /** * A directive that selects a [template](link:site.data.urls.angular['templatesyntax']) * within the `<kendo-chart-tooltip>` component for the * [shared series tooltip](slug:tooltips_chart_charts#toc-shared-tooltip-customization). * The available fields in the template context are: * - `let-points="points"`&mdash;An array of the [`TooltipTemplatePoints`](slug:api_charts_tooltiptemplatepoint) category. * - `let-category="category"`&mdash;The category name. * - `let-categoryText="categoryText"`&mdash;The category name as text. * - `let-nameColumn="nameColumn"`&mdash;Returns a Boolean [`value`](slug:api_charts_seriesitemcomponent#toc-name) indicating whether the name property of the `SeriesItemComponent` is defined. * - `let-colorMarker="colorMarker"`&mdash;Returns a Boolean value indicating whether one or more series colors are specified in the Chart. If the Chart contains only one `SeriesItemComponent`, the context field will return `false`. * - `let-colSpan="colSpan"`&mdash;Specifies the number of columns covered by the tooltip. The default value is `1` and increases by `1` if `nameColumn` and `colorMarker` are set to `true`. * * @example * ```ts * import { Component } from '@angular/core'; * * _@Component({ * selector: 'my-app', * template: ` * <kendo-chart> * <kendo-chart-tooltip [shared]="true"> * <ng-template kendoChartSharedTooltipTemplate let-category="category" let-points="points"> * <div> {{ category }} </div> * <div *ngFor="let point of points"> * {{ point.series.name }} : {{ point.value }} * </div> * </ng-template> * </kendo-chart-tooltip> * <kendo-chart-category-axis> * <kendo-chart-category-axis-item [categories]="['A', 'B', 'C']"> * </kendo-chart-category-axis-item> * </kendo-chart-category-axis> * <kendo-chart-series> * <kendo-chart-series-item name="A" [data]="[1, 2, 3]"> * </kendo-chart-series-item> * <kendo-chart-series-item name="B" [data]="[1, 2, 3]"> * </kendo-chart-series-item> * </kendo-chart-series> * </kendo-chart> * ` * }) * class AppComponent { * } * * ``` */ export class SharedTooltipTemplateDirective { templateRef; constructor(templateRef) { this.templateRef = templateRef; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SharedTooltipTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: SharedTooltipTemplateDirective, isStandalone: true, selector: "[kendoChartSharedTooltipTemplate]", ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: SharedTooltipTemplateDirective, decorators: [{ type: Directive, args: [{ selector: '[kendoChartSharedTooltipTemplate]', standalone: true }] }], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{ type: Optional }] }]; } });