@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.
116 lines (115 loc) • 3.7 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2024 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { drawing } from '@progress/kendo-drawing';
import { Border, DashType, LegendItemVisualArgs } from '../../common/property-types';
import { SeriesMarkers } from './../series-item/markers.interface';
/**
* The configuration options of the legend item.
*/
export interface LegendItem {
/**
* The cursor style of the legend item.
*/
cursor?: string;
/**
* Sets the type of the legend item.
* The default value is based on the series type.
*/
type?: LegendItemType;
/**
* Sets the configuration of the legend items of type `line`.
* This is the default legend item type for all line and scatter series.
*/
line?: LegendItemLine;
/**
* Sets the configuration of the legend items of type `area`.
* By default, all series except line and scatter use this legend type.
*/
area?: LegendItemArea;
/**
* The markers configuration of the legend item.
* Defaults to the series options.
*/
markers?: LegendItemMarkers;
/**
* The highlight configuration of the legend item.
*/
highlight?: LegendItemHighlight;
/**
* A function for creating a custom visual for the legend items.
*/
visual?: (e: LegendItemVisualArgs) => drawing.Element;
}
/**
* The configuration of the Chart legend item markers border.
*/
export interface LegendItemMarkersBorder extends Omit<Border, 'width'> {
}
/**
* The configuration of the Chart legend item markers.
*/
export interface LegendItemMarkers extends Omit<SeriesMarkers, 'size' | 'border' | 'rotation' | 'from' | 'to'> {
/**
* The border of the markers.
*/
border?: LegendItemMarkersBorder;
}
/**
* The configuration of the Chart legend item highlight state.
*/
export interface LegendItemHighlight {
/**
* If set to `false`, the hover effect of the legend item is disabled.
*/
visible?: boolean;
/**
* The `markers` configuration of the legend item when it is hovered.
*/
markers?: LegendItemMarkers;
}
/**
* The configuration of the Chart legend item of type `line`.
* Defaults to the series options.
*/
export interface LegendItemLine {
/**
* The color of the legend item. Accepts a valid CSS color string, including HEX and RGB.
* Defaults to the series color.
*/
color?: string;
/**
* The opacity of the legend item.
* Defaults to the series opacity.
*/
opacity?: number;
/**
* The dash type of the legend item.
* Defaults to the series dash type.
*/
dashType?: DashType;
}
/**
* The configuration of the Chart legend items of type `area`.
* Defaults to the series options.
*/
export interface LegendItemArea {
/**
* The background color of the legend item. Accepts a valid CSS color string, including HEX and RGB.
* Defaults to the series color.
*/
background?: string;
/**
* The opacity of the legend item.
* Defaults to the series opacity.
*/
opacity?: number;
}
/**
* The type of the Chart legend item.
*
* - `"line"`—the legend items are rendered as a line. This is the default value for line charts.
* - `"area"`—the legend items are rendered as a filled rectangle. This is the default value for area charts.
*/
export type LegendItemType = 'line' | 'area';