UNPKG

@progress/kendo-react-charts

Version:

React Chart renders a wide range of high-quality data visualizations. KendoReact Charts package

125 lines (124 loc) 4.04 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { drawing } from '@progress/kendo-drawing'; import { Border, DashType, LegendItemVisualArgs } from '../../common/property-types.js'; import { SeriesMarkers } from './../series-item/markers.interface.js'; /** * The configuration of the Chart 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. * * The available argument fields are: * - `options`&mdash;The item options. * - `createVisual`&mdash;A function for getting the default visual. * - `series`&mdash;The item series. * - `pointIndex`&mdash;The index of the point in the series. Available for the Pie, Donut, and Funnel series. */ 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"`&mdash;the legend items are rendered as a line. This is the default value for line charts. * - `"area"`&mdash;the legend items are rendered as a filled rectangle. This is the default value for area charts. */ export type LegendItemType = 'line' | 'area';