@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.
42 lines (41 loc) • 1.97 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { BaseUnit } from './base-unit';
/**
* The `baseUnit` type of the category axis.
*
* The possible values are:
* - [`BaseUnit`](slug:api_charts_baseunit)—The base time interval for the axis labels.
* - `"auto"`—The base unit is automatically determined by the minimum difference between subsequent categories.
* - `"fit"`—The [`categoryAxis.baseUnitStep`](slug:api_charts_categoryaxis#toc-baseunitstep) and base unit are adjusted so that the number of categories does not exceed [`categoryAxis.maxDateGroups`](slug:api_charts_categoryaxis#toc-maxdategroups), and the [`series.aggregate`](slug:api_charts_series#toc-aggregate) function is used to aggregate data based on the selected base unit.
*
* @example
* ```ts
* import { Component } from '@angular/core';
* import { CategoryBaseUnit } from '@progress/kendo-angular-charts';
*
* _@Component({
* selector: 'my-app',
* template: `
* <kendo-chart>
* <kendo-chart-category-axis>
* <kendo-chart-category-axis-item [baseUnit]="baseUnit" >
* </kendo-chart-category-axis-item>
* </kendo-chart-category-axis>
* <kendo-chart-series>
* <kendo-chart-series-item categoryField="category" [data]="data">
* </kendo-chart-series-item>
* </kendo-chart-series>
* </kendo-chart>
* `
* })
* class AppComponent {
* public baseUnit: CategoryBaseUnit = "months";
* public data: any[] = [{ category: new Date(2000, 0, 1), value: 1 }, { category: new Date(2001, 0, 1), value: 1}];
* }
*
* ```
*/
export type CategoryBaseUnit = BaseUnit | 'auto' | 'fit';