New to Kendo UI for Angular? Start a free 30-day trial
SharedTooltipTemplateDirective
A directive that selects a template
within the <kendo-chart-tooltip>
component for the
shared series tooltip.
The available fields in the template context are:
let-points="points"
—An array of theTooltipTemplatePoints
category.let-category="category"
—The category name.let-categoryText="categoryText"
—The category name as text.let-nameColumn="nameColumn"
—Returns a Booleanvalue
indicating whether the name property of theSeriesItemComponent
is defined.let-colorMarker="colorMarker"
—Returns a Boolean value indicating whether one or more series colors are specified in the Chart. If the Chart contains only oneSeriesItemComponent
, the context field will returnfalse
.let-colSpan="colSpan"
—Specifies the number of columns covered by the tooltip. The default value is1
and increases by1
ifnameColumn
andcolorMarker
are set totrue
.
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 {
}
Selector
[kendoChartSharedTooltipTemplate]