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.

266 lines (265 loc) 10 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 configuration component for a category axis ([see example]({% slug axes_chart_charts %})). * * @remarks * Supported children components are: {@link CategoryAxisCrosshairComponent}, {@link CategoryAxisLabelsComponent}, * {@link CategoryAxisNotesComponent}, {@link CategoryAxisSelectComponent}, {@link CategoryAxisTitleComponent}, and {@link CategoryAxisRangeLabelsComponent}. */ export class CategoryAxisItemComponent extends CollectionItemComponent { configurationService; collectionService; intl; /** * Specifies the automatic base unit steps configuration. */ autoBaseUnitSteps; /** * Specifies the axis crossing value or values. */ axisCrossingValue; /** * Specifies the background color of the axis. */ background; /** * Specifies the base unit of the axis. */ baseUnit; /** * Specifies the base unit step of the axis. */ baseUnitStep; /** * Specifies the categories for the axis. */ categories; /** * Specifies the color of the axis. */ color; /** * Determines whether the axis is justified. */ justified; /** * Specifies the line configuration of the axis. */ line; /** * Specifies the major grid lines configuration of the axis. */ majorGridLines; /** * Specifies the major ticks configuration of the axis. */ majorTicks; /** * Specifies the maximum value of the axis. */ max; /** * Specifies the maximum number of groups (categories) to display when * [`categoryAxis.baseUnit`]({% slug api_charts_categoryaxis %}#toc-baseunit) is set to `"fit"` or * [`categoryAxis.baseUnitStep`]({% slug api_charts_categoryaxis %}#toc-baseunitstep) is set to `"auto"`. * @default 10 */ maxDateGroups; /** * Specifies the maximum divisions of the axis. */ maxDivisions; /** * Specifies the minimum value of the axis. */ min; /** * Specifies the minor grid lines configuration of the axis. */ minorGridLines; /** * Specifies the minor ticks configuration of the axis. */ minorTicks; /** * Specifies the unique axis name. Use it to associate a series with a category axis, * which utilizes the [`series.categoryAxis`]({% slug api_charts_series %}#toc-categoryaxis) option. * @default 'primary' */ name; /** * Specifies the pane of the axis. */ pane; /** * Specifies the plot bands configuration of the axis. */ plotBands; /** * Determines whether the category axis direction is reversed. * Categories are listed from left to right and from bottom to top by default. * @default false */ reverse; /** * Determines whether the Chart rounds the first and last date to the nearest base unit. * @default true */ roundToBaseUnit; /** * Specifies the angle (degrees) of the first category on the axis. * Use positive values to increase the angle clockwise with zero to the left. Negative values are acceptable. * @default 90 */ startAngle; /** * Specifies the category axis type. * Use `category` for a discrete category axis and `date` for a specialized axis for displaying chronological data. * @default 'category' */ type; /** * Determines whether the Chart displays the category axis. The category axis is visible by default. * @default true */ visible; /** * Specifies the week start day when the `baseUnit` is set to `"weeks"`. * @default 'Sunday' */ weekStartDay; // These options are also available as child components /** * Specifies the crosshair configuration of the axis. */ crosshair; /** * Specifies the labels configuration of the axis. */ labels; /** * Specifies the notes configuration of the axis. */ notes; /** * Specifies the selection configuration of the axis. */ select; /** * Specifies the title configuration of the axis. */ title; /** * Specifies the range labels configuration of the axis. */ rangeLabels; 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: CategoryAxisItemComponent, 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: CategoryAxisItemComponent, isStandalone: true, selector: "kendo-chart-category-axis-item", inputs: { autoBaseUnitSteps: "autoBaseUnitSteps", axisCrossingValue: "axisCrossingValue", background: "background", baseUnit: "baseUnit", baseUnitStep: "baseUnitStep", categories: "categories", color: "color", justified: "justified", line: "line", majorGridLines: "majorGridLines", majorTicks: "majorTicks", max: "max", maxDateGroups: "maxDateGroups", maxDivisions: "maxDivisions", min: "min", minorGridLines: "minorGridLines", minorTicks: "minorTicks", name: "name", pane: "pane", plotBands: "plotBands", reverse: "reverse", roundToBaseUnit: "roundToBaseUnit", startAngle: "startAngle", type: "type", visible: "visible", weekStartDay: "weekStartDay", crosshair: "crosshair", labels: "labels", notes: "notes", select: "select", title: "title", rangeLabels: "rangeLabels" }, 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: CategoryAxisItemComponent, decorators: [{ type: Component, args: [{ changeDetection: ChangeDetectionStrategy.OnPush, providers: [ConfigurationService], selector: 'kendo-chart-category-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: { autoBaseUnitSteps: [{ type: Input }], axisCrossingValue: [{ type: Input }], background: [{ type: Input }], baseUnit: [{ type: Input }], baseUnitStep: [{ type: Input }], categories: [{ type: Input }], color: [{ type: Input }], justified: [{ type: Input }], line: [{ type: Input }], majorGridLines: [{ type: Input }], majorTicks: [{ type: Input }], max: [{ type: Input }], maxDateGroups: [{ type: Input }], maxDivisions: [{ type: Input }], min: [{ type: Input }], minorGridLines: [{ type: Input }], minorTicks: [{ type: Input }], name: [{ type: Input }], pane: [{ type: Input }], plotBands: [{ type: Input }], reverse: [{ type: Input }], roundToBaseUnit: [{ type: Input }], startAngle: [{ type: Input }], type: [{ type: Input }], visible: [{ type: Input }], weekStartDay: [{ type: Input }], crosshair: [{ type: Input }], labels: [{ type: Input }], notes: [{ type: Input }], select: [{ type: Input }], title: [{ type: Input }], rangeLabels: [{ type: Input }] } });