@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.
182 lines (181 loc) • 6.95 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { ConfigurationService } from '../common/configuration.service';
import { SettingsComponent } from '../common/settings.component';
import * as i0 from "@angular/core";
import * as i1 from "../common/configuration.service";
/**
* Represents the Kendo UI for Angular Chart Legend configuration
* ([see example]({% slug legend_chart_charts %})).
*
* @example
* ```html
* <kendo-chart>
* <kendo-chart-legend position="top" [visible]="true">
* </kendo-chart-legend>
* </kendo-chart>
* ```
*
* @remarks
* Supported children components are: {@link LegendInactiveItemsComponent} and {@link LegendItemComponent}.
*/
export class LegendComponent extends SettingsComponent {
configurationService;
/**
* Specifies the alignment of the legend.
* The legend is horizontally aligned when [`legend.position`]({% slug api_charts_legend %}#toc-position) is set to `"top"` or `"bottom"`.
* The legend is vertically aligned when [`legend.position`]({% slug api_charts_legend %}#toc-position) is set to `"left"` or `"right"`.
* @default 'center'
*/
align;
/**
* Specifies the background color of the legend. Accepts a valid CSS color string, including hex and rgb.
* @default 'white'
*/
background;
/**
* Specifies the border configuration of the legend.
*/
border;
/**
* Specifies the height of the legend.
*/
height;
/**
* Specifies the labels configuration of the legend.
*/
labels;
/**
* Specifies the margin of the Chart legend. A numeric value sets all paddings.
* @default 5
*/
margin;
/**
* Specifies the X offset of the Chart legend. The offset is relative to the default position of the legend.
* For example, a value of `20` moves the legend 20 pixels to the right of its initial position.
* Negative values move the legend to the left of its current position.
* @default 0
*/
offsetX;
/**
* Specifies the Y offset of the chart legend. The offset is relative to the current position of the legend.
* For example, a value of `20` moves the legend 20 pixels down from its initial position.
* Negative values move the legend upwards from its current position.
* @default 0
*/
offsetY;
/**
* Specifies the orientation of the legend items.
* @default 'vertical'
*/
orientation;
/**
* Specifies the padding of the Chart legend. A numeric value sets all paddings.
* @default 5
*/
padding;
/**
* Specifies the positions of the Chart legend.
* Setting the legend position to `custom` allows you to position the legend using the [`legend.offsetX`](slug:api_charts_legend#toc-offsetx) and [`legend.offsetY`](slug:api_charts_legend#toc-offsety) options.
* @default 'right'
*/
position;
/**
* Determines whether the legend items are reversed.
* @default false
*/
reverse;
/**
* Determines whether the Chart displays the legend. By default, the Chart legend is visible.
* @default true
*/
visible;
/**
* Specifies the width of the legend.
*/
width;
/**
* Specifies the markers configuration of the legend.
*/
markers;
/**
* Specifies the spacing between legend items.
*/
spacing;
// These options are also available as child components
/**
* Specifies the inactive items configuration of the legend.
*/
inactiveItems;
/**
* Specifies the item configuration of the legend.
*/
item;
/**
* Specifies the title configuration of the legend.
*/
title;
/**
* Specifies the focus highlight configuration of the legend.
*/
focusHighlight;
constructor(configurationService) {
super('legend', configurationService);
this.configurationService = configurationService;
this.markAsVisible();
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LegendComponent, deps: [{ token: i1.ConfigurationService }], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LegendComponent, isStandalone: true, selector: "kendo-chart-legend", inputs: { align: "align", background: "background", border: "border", height: "height", labels: "labels", margin: "margin", offsetX: "offsetX", offsetY: "offsetY", orientation: "orientation", padding: "padding", position: "position", reverse: "reverse", visible: "visible", width: "width", markers: "markers", spacing: "spacing", inactiveItems: "inactiveItems", item: "item", title: "title", focusHighlight: "focusHighlight" }, usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LegendComponent, decorators: [{
type: Component,
args: [{
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'kendo-chart-legend',
template: '',
standalone: true
}]
}], ctorParameters: function () { return [{ type: i1.ConfigurationService }]; }, propDecorators: { align: [{
type: Input
}], background: [{
type: Input
}], border: [{
type: Input
}], height: [{
type: Input
}], labels: [{
type: Input
}], margin: [{
type: Input
}], offsetX: [{
type: Input
}], offsetY: [{
type: Input
}], orientation: [{
type: Input
}], padding: [{
type: Input
}], position: [{
type: Input
}], reverse: [{
type: Input
}], visible: [{
type: Input
}], width: [{
type: Input
}], markers: [{
type: Input
}], spacing: [{
type: Input
}], inactiveItems: [{
type: Input
}], item: [{
type: Input
}], title: [{
type: Input
}], focusHighlight: [{
type: Input
}] } });