UNPKG

@progress/kendo-react-chart-wizard

Version:

React Chart Wizard lets you create a chart using data from a Grid, another data-bound component, or an external source

245 lines (218 loc) 7.21 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { Chart } from '@progress/kendo-react-charts'; import { ChartWizardArea } from '@progress/kendo-charts'; import { ChartWizardCategoryAxisItem } from '@progress/kendo-charts'; import { ChartWizardDataCell } from '@progress/kendo-charts'; import { ChartWizardDataRow } from '@progress/kendo-charts'; import { ChartWizardDefaultState } from '@progress/kendo-charts'; import { ChartWizardLegend } from '@progress/kendo-charts'; import { ChartWizardSeriesItem } from '@progress/kendo-charts'; import { ChartWizardSeriesItemLabel } from '@progress/kendo-charts'; import { ChartWizardSeriesStack } from '@progress/kendo-charts'; import { ChartWizardSeriesType } from '@progress/kendo-charts'; import { ChartWizardState } from '@progress/kendo-charts'; import { ChartWizardTitle } from '@progress/kendo-charts'; import { ChartWizardValueAxisItem } from '@progress/kendo-charts'; import { DataColumn } from '@progress/kendo-charts'; import { DataRow } from '@progress/kendo-charts'; import { GridHandle } from '@progress/kendo-react-grid'; import { ImageExportOptions } from '@progress/kendo-drawing'; import { PDFOptions } from '@progress/kendo-drawing/pdf'; import * as React_2 from 'react'; import { WindowProps } from '@progress/kendo-react-dialogs'; /** * The KendoReact ChartWizard component. */ export declare const ChartWizard: React_2.ForwardRefExoticComponent<ChartWizardProps & React_2.RefAttributes<ChartWizardHandle | null>>; export { ChartWizardArea } export { ChartWizardCategoryAxisItem } export { ChartWizardDataCell } export { ChartWizardDataRow } export { ChartWizardDefaultState } /** * Represents the `ref` object of the ChartWizard component. **/ export declare interface ChartWizardHandle { /** * Gets the Chart instance. */ chart: Chart | null; /** * @hidden * * The current state of the ChartWizard. */ state: ChartWizardState; } export { ChartWizardLegend } /** * The props of the KendoReact ChartWizard component. */ export declare interface ChartWizardProps { /** * Specifies the data you want to display in the ChartWizard component. */ data?: ChartWizardDataRow[]; /** * Fires when you close the ChartWizard component. */ onClose?: () => void; /** * Fires when the Chart exports. You can prevent this action. */ onExport?: (event: ExportEvent) => void; /** * Sets the export options for the ChartWizard component. */ exportOptions?: ExportOptions; /** * Sets the default state of the ChartWizard component. */ defaultState?: ChartWizardDefaultState; /** * Sets the component that renders the ChartWizard window. */ window?: React.ComponentType<WindowProps>; /** * Fires when the ChartWizard component state changes. */ onStateChange?: (state: ChartWizardState) => void; /** * Controls the state of the ChartWizard component. */ state?: ChartWizardState; } export { ChartWizardSeriesItem } export { ChartWizardSeriesItemLabel } export { ChartWizardSeriesStack } export { ChartWizardSeriesType } export { ChartWizardState } export { ChartWizardTitle } export { ChartWizardValueAxisItem } /** * Creates a state object from the provided data and series type. * * @param data - Specifies the data you want to display in the ChartWizard component. * @param seriesType - Sets the series type of the ChartWizard component. * @returns The state object. */ export declare const createState: (data: ChartWizardDataRow[], seriesType: ChartWizardSeriesType) => ChartWizardState; export { DataColumn } export { DataRow } /** * Provides arguments for the `export` event on the Chart Wizard. */ export declare class ExportEvent extends PreventableEvent { /** * Gets the export options on the Chart Wizard. */ exportOptions: ExportOptions; /** * Gets the current Chart chart instance you want to export. */ chart: Chart; constructor(chart: Chart, exportOptions: ExportOptions); } /** * Sets the export options for the Chart Wizard. */ export declare interface ExportOptions { /** * Sets the filename for exported files. * * @default 'chart' */ fileName?: string; /** * Configures PDF export options. * * @default { paperSize: 'A4', margin: '1cm' } */ pdf?: PDFOptions; /** * Configures image export options. * * @default { width: 800, height: 600 } */ image?: ImageExportOptions; } /** * Maps the Grid selectedState to a more general DataRows type you can display in the Chart Wizard. * * The selectedKeys can be either row keys or cell keys. * * @returns DataRow array that you can pass to `getWizardDataFromDataRows` to bind the Chart Wizard. */ export declare function getGridSelectedRows(args: { /** * Specifies the Grid handle instance. */ grid: GridHandle | null; /** * Sets the data array from the Grid. */ data: any[]; /** * Configures the current selection state. */ selectedState: { [id: string]: boolean | number[]; }; /** * Sets the key property for identifying data items. */ dataItemKey: string; }): DataRow[]; export declare const getWizardDataFromDataRows: (dataRows: DataRow[]) => ChartWizardDataRow[]; /** * Maps the Grid selectedState to data you can display in the Chart Wizard. * * Supports both row and cell selection. * * @returns A collection that you can use as Chart Wizard data. */ export declare const getWizardDataFromGridSelection: (args: { /** * Specifies the Grid handle instance. */ grid: GridHandle | null; /** * Sets the data array from the Grid. */ data: any[]; /** * Configures the current selection state. */ selectedState: { [id: string]: boolean | number[]; }; /** * Sets the key property for identifying data items. */ dataItemKey: string; }) => ChartWizardDataRow[]; /** * @hidden */ declare abstract class PreventableEvent { private prevented; /** * Prevents the default action for a specific event. * This action stops the source component from executing its built-in behavior that follows the event. */ preventDefault(): void; /** * Returns `true` if any of the event subscribers prevented the event. * * @returns - Returns `true` if you prevented the default action. * Otherwise, returns `false`. */ isDefaultPrevented(): boolean; } export { }