@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.
167 lines (166 loc) • 8.48 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 { AutoBaseUnitSteps, AxisLine, AxisTicks, CategoryBaseUnit, GridLines, PlotBand, WeekStartDay } from '../common/property-types';
import { CategoryAxisCrosshair } from './category-axis-item/crosshair.interface';
import { CategoryAxisLabels } from './category-axis-item/labels.interface';
import { CategoryAxisRangeLabels } from './category-axis-item/range-labels.interface';
import { CategoryAxisNotes } from './category-axis-item/notes.interface';
import { CategoryAxisSelect } from './category-axis-item/select.interface';
import { CategoryAxisTitle } from './category-axis-item/title.interface';
/**
* Represents the category axis configuration options.
*/
export interface CategoryAxis {
/**
* Sets the time-interval steps when `baseUnit` is set to `"fit"` or `"auto"`.
* The axis tries to divide the active period into the smallest possible units that yield `maxDateGroups` or less discrete intervals.
*/
autoBaseUnitSteps?: AutoBaseUnitSteps;
/**
* Sets the category index or date at which the first value axis crosses this axis.
* Use an array to set the category indices or dates at which the value axes cross the category axis. To denote the far end of the axis, set an index greater than or equal to the number of categories.
*/
axisCrossingValue?: any | any[];
/**
* Sets the background color of the axis.
*/
background?: string;
/**
* Sets the base time interval for the date axis.
* The default base unit is automatically determined by the minimum difference between subsequent categories. Use `"fit"` to set a base unit and [`categoryAxis.baseUnitStep`](slug:api_charts_categoryaxis#toc-baseunitstep) so the total number of categories does not exceed [`categoryAxis.maxDateGroups`](slug:api_charts_categoryaxis#toc-maxdategroups). Series data is aggregated for the specified base unit by using the [`series.aggregate`](slug:api_charts_series#toc-aggregate) function.
*/
baseUnit?: CategoryBaseUnit;
/**
* Sets the step (interval) between categories in base units.
* Use `"auto"` to set the step so the total number of categories does not exceed [`categoryAxis.maxDateGroups`](slug:api_charts_categoryaxis#toc-maxdategroups). This option is ignored if [`categoryAxis.baseUnit`](slug:api_charts_categoryaxis#toc-baseunit) is set to `"fit"`.
*/
baseUnitStep?: number | 'auto';
/**
* Sets the category names.
* The Chart creates a category for every item of the array.
*/
categories?: any[];
/**
* Sets the color to apply to all axis elements.
* Accepts a valid CSS color string, including HEX and RGB and can be overridden by [`categoryAxis.labels.color`](slug:api_charts_categoryaxislabels#toc-color) and [`categoryAxis.line.color`](slug:api_charts_axisline#toc-color).
*/
color?: string;
/**
* Determines if the Chart positions categories and series points on major ticks.
* This removes the empty space before and after the series. The default value is `false` except for `"area"`, `"verticalArea"`, `"rangeArea"`, and `"verticalRangeArea"`. This option is ignored if [`series.type`](slug:api_charts_series#toc-type) is set to `"bar"`, `"column"`, `"boxPlot"`, `"ohlc"`, `"candlestick"`, or `"waterfall"`.
*/
justified?: boolean;
/**
* Configures the axis lines.
* Also affects the major and minor ticks, but not the grid lines.
*/
line?: AxisLine;
/**
* Configures the major grid lines.
* These are the lines that are an extension of the major ticks through the body of the Chart.
*/
majorGridLines?: GridLines;
/**
* Configures the category axis major ticks.
*/
majorTicks?: AxisTicks;
/**
* Sets the last date displayed on a date category axis or the index of the last category displayed on a category axis.
* By default, the max value is the same as the last category. This is often used in combination with [`categoryAxis.min`]({% slug api_charts_categoryaxis %}#toc-min) and [`categoryAxis.roundToBaseUnit`]({% slug api_charts_categoryaxis %}#toc-roundtobaseunit) to set up a fixed date range.
*/
max?: any;
/**
* Sets 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"`.
*/
maxDateGroups?: number;
/**
* Sets the maximum number of ticks and labels to display.
* Applicable for date category axis.
*/
maxDivisions?: number;
/**
* Sets the first date displayed on a date category axis or the index of the first category displayed on a category axis.
* By default, the min value is the same as the first category. This is often used in combination with [`categoryAxis.max`]({% slug api_charts_categoryaxis %}#toc-max) and [`categoryAxis.roundToBaseUnit`]({% slug api_charts_categoryaxis %}#toc-roundtobaseunit) to set up a fixed date range.
*/
min?: any;
/**
* Configures the minor grid lines.
* These are the lines that are an extension of the minor ticks through the body of the Chart.
*/
minorGridLines?: GridLines;
/**
* Configures the category axis minor ticks.
*/
minorTicks?: AxisTicks;
/**
* Sets the unique axis name.
* Used to associate a series with a category axis, which utilizes the [`series.categoryAxis`]({% slug api_charts_series %}#toc-categoryaxis) option.
*/
name?: string;
/**
* Configures the date axis date range labels.
*/
rangeLabels?: CategoryAxisRangeLabels;
/**
* Sets the name of the pane in which the category axis has to be rendered.
* If not set, the axis will be rendered in the first (default) pane.
*/
pane?: string;
/**
* Sets the plot bands of the category axis.
*/
plotBands?: PlotBand[];
/**
* Determines if the category axis direction is reversed.
* By default, categories are listed from left to right and from bottom to top.
*/
reverse?: boolean;
/**
* Determines if the Chart rounds the first and last date to the nearest base unit.
*/
roundToBaseUnit?: boolean;
/**
* Sets the angle (degrees) of the first category on the axis.
* Angles increase clockwise with zero to the left and negative values are acceptable.
*/
startAngle?: number;
/**
* Sets the category axis type.
* Use `"category"` for a discrete category axis or `"date"` for a specialized axis for displaying chronological data.
*/
type?: 'category' | 'date';
/**
* Determines if the Chart displays the category axis.
* By default, the category axis is visible.
*/
visible?: boolean;
/**
* Sets the week start day when the `baseUnit` is set to `"weeks"`.
*/
weekStartDay?: WeekStartDay;
/**
* Configures the crosshair options.
* The crosshair is displayed when the [`categoryAxis.crosshair.visible`]({% slug api_charts_categoryaxiscrosshair %}#toc-visible) option is set to `true`.
*/
crosshair?: CategoryAxisCrosshair;
/**
* Configures the axis labels.
*/
labels?: CategoryAxisLabels;
/**
* Configures the category axis notes.
*/
notes?: CategoryAxisNotes;
/**
* Configures the selected axis range.
* Setting this option enables axis selection and the range is index-based, starting from zero. Categories with indexes in the range (`select.from`, `select.to`) will be selected, but the last category in the range will not be included in the selection. If the categories are dates, specify the range with date values. Selection is only supported if the axis is horizontal.
*/
select?: CategoryAxisSelect;
/**
* Configures the title of the category axis.
* To display the title, set the [`categoryAxis.title.text`]({% slug api_charts_categoryaxistitle %}#toc-text) option.
*/
title?: CategoryAxisTitle;
}