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.

240 lines (239 loc) 8.63 kB
/**----------------------------------------------------------------------------------------- * 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, Inject, Input, LOCALE_ID } from '@angular/core'; import { IntlService } from '@progress/kendo-angular-intl'; import { CollectionItemComponent } from '../common/collection-item.component'; import { CollectionService } from '../common/collection.service'; import { ConfigurationService } from '../common/configuration.service'; import { WeekStartDay } from '../common/property-types'; import * as i0 from "@angular/core"; import * as i1 from "../common/configuration.service"; import * as i2 from "../common/collection.service"; import * as i3 from "@progress/kendo-angular-intl"; /** * Represents the Kendo UI for Angular Chart X Axis Item component * ([see example]({% slug api_charts_xaxiscomponent %})). * * @example * ```html * <kendo-chart> * <kendo-chart-x-axis> * <kendo-chart-x-axis-item> * <kendo-chart-x-axis-item-title text="X Axis Title"></kendo-chart-x-axis-item-title> * </kendo-chart-x-axis-item> * </kendo-chart-x-axis> * </kendo-chart> * ``` * * @remarks * Supported children components are: {@link XAxisCrosshairComponent}, {@link XAxisLabelsComponent}, {@link XAxisNotesComponent}, and {@link XAxisTitleComponent}. */ export class XAxisItemComponent extends CollectionItemComponent { configurationService; collectionService; intl; /** * Specifies the value or array of values at which the axis crosses with another axis. */ axisCrossingValue; /** * Specifies the background color of the axis. */ background; /** * Specifies the base time unit for the axis. */ baseUnit; /** * Specifies the categories for the axis. */ categories; /** * Specifies the color of the axis. */ color; /** * Specifies the configuration of the axis line. */ line; /** * Specifies the configuration of the major grid lines. */ majorGridLines; /** * Specifies the configuration of the major ticks. */ majorTicks; /** * Specifies the interval between major divisions. */ majorUnit; /** * Specifies the maximum value of the axis. */ max; /** * Specifies the minimum value of the axis. */ min; /** * Specifies the configuration of the minor grid lines. */ minorGridLines; /** * Specifies the configuration of the minor ticks. */ minorTicks; /** * Specifies the interval between minor divisions. */ minorUnit; /** * Specifies the unique name of the axis. */ name; /** * Determines whether the Chart prevents the automatic axis range from snapping to zero. */ narrowRange; /** * Specifies the name of the pane that the axis renders in. */ pane; /** * Specifies the plot bands configuration. */ plotBands; /** * Determines whether the axis direction is reversed. */ reverse; /** * Specifies the start angle for radar and polar axes. */ startAngle; /** * Specifies the axis type. * * The options are `numeric` for a numeric axis, `date` for a specialized axis for displaying chronological data, and `log` for a logarithmic axis. * * If the series X value is of the `date` type, the Chart automatically switches to a date axis. * To avoid this behavior, set the `type`. * @default 'numeric' */ type; /** * Determines whether the Chart displays the X axis. By default, the X axis is visible. * @default true */ visible; /** * Specifies the first day of the week. */ weekStartDay; // These options are also available as child components /** * Specifies the configuration of the crosshair. */ crosshair; /** * Specifies the configuration of the labels. */ labels; /** * Specifies the configuration of the notes. */ notes; /** * Specifies the configuration of the title. */ title; intlSubscription; constructor(configurationService, collectionService, intl, localeId) { super(configurationService, collectionService); this.configurationService = configurationService; this.collectionService = collectionService; this.intl = intl; intl.localeId = localeId; this.notifyChanges({ weekStartDay: intl.firstDay(intl.localeId) }); this.intlSubscription = intl.changes.subscribe(() => { this.notifyChanges({ weekStartDay: intl.firstDay(intl.localeId) }); }); } ngOnDestroy() { if (this.intlSubscription) { this.intlSubscription.unsubscribe(); } } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: XAxisItemComponent, deps: [{ token: i1.ConfigurationService }, { token: i2.CollectionService }, { token: i3.IntlService }, { token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: XAxisItemComponent, isStandalone: true, selector: "kendo-chart-x-axis-item", inputs: { axisCrossingValue: "axisCrossingValue", background: "background", baseUnit: "baseUnit", categories: "categories", color: "color", line: "line", majorGridLines: "majorGridLines", majorTicks: "majorTicks", majorUnit: "majorUnit", max: "max", min: "min", minorGridLines: "minorGridLines", minorTicks: "minorTicks", minorUnit: "minorUnit", name: "name", narrowRange: "narrowRange", pane: "pane", plotBands: "plotBands", reverse: "reverse", startAngle: "startAngle", type: "type", visible: "visible", weekStartDay: "weekStartDay", crosshair: "crosshair", labels: "labels", notes: "notes", title: "title" }, providers: [ConfigurationService], usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: XAxisItemComponent, decorators: [{ type: Component, args: [{ changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfigurationService], selector: 'kendo-chart-x-axis-item', template: '', standalone: true }] }], ctorParameters: function () { return [{ type: i1.ConfigurationService }, { type: i2.CollectionService }, { type: i3.IntlService }, { type: undefined, decorators: [{ type: Inject, args: [LOCALE_ID] }] }]; }, propDecorators: { axisCrossingValue: [{ type: Input }], background: [{ type: Input }], baseUnit: [{ type: Input }], categories: [{ type: Input }], color: [{ type: Input }], line: [{ type: Input }], majorGridLines: [{ type: Input }], majorTicks: [{ type: Input }], majorUnit: [{ type: Input }], max: [{ type: Input }], min: [{ type: Input }], minorGridLines: [{ type: Input }], minorTicks: [{ type: Input }], minorUnit: [{ type: Input }], name: [{ type: Input }], narrowRange: [{ type: Input }], pane: [{ type: Input }], plotBands: [{ type: Input }], reverse: [{ type: Input }], startAngle: [{ type: Input }], type: [{ type: Input }], visible: [{ type: Input }], weekStartDay: [{ type: Input }], crosshair: [{ type: Input }], labels: [{ type: Input }], notes: [{ type: Input }], title: [{ type: Input }] } });