import { Question } from "survey-core"; import { VisualizerBase } from "./visualizerBase"; import { IVisualizerPanelRenderedElement, PanelElement } from "./visualizationPanel"; /** * Defines configuration options for a dashboard item. * * Pass an array of `IDashboardItemOptions` objects to the [`items`](https://surveyjs.io/dashboard/documentation/api-reference/dashboard#items) array when initializing the Dashboard. * * [View Demo](https://surveyjs.io/dashboard/examples/customer-satisfaction-survey-analysis/ (linkStyle)) * @since 3.0.0 */ export interface IDashboardItemOptions { /** * A unique identifier for the item. * @since 3.0.0 */ name?: string; /** * The data field the item is bound to. If not specified, the [`name`](#name) value is used. * @since 3.0.0 */ dataField?: string; /** * The item type (visualization type). * * Supported values: * * - [`"bar"`](https://surveyjs.io/dashboard/documentation/chart-types#bar-chart) * - [`"vbar"`](https://surveyjs.io/dashboard/documentation/chart-types#bar-chart) * - [`"pie"`](https://surveyjs.io/dashboard/documentation/chart-types#pie-chart) * - [`"doughnut"`](https://surveyjs.io/dashboard/documentation/chart-types#doughnut-chart) * - [`"histogram"`](https://surveyjs.io/dashboard/documentation/chart-types#histogram) * - [`"vhistogram"`](https://surveyjs.io/dashboard/documentation/chart-types#histogram) * - [`"gauge"`](https://surveyjs.io/dashboard/documentation/chart-types#gauge-chart) * - [`"bullet"`](https://surveyjs.io/dashboard/documentation/chart-types#bullet-chart) * - [`"radar"`](https://surveyjs.io/dashboard/documentation/chart-types#radar-chart-spider-chart) * - [`"stackedbar"`](https://surveyjs.io/dashboard/documentation/chart-types#stacked-bar-chart) * - [`"wordcloud"`](https://surveyjs.io/dashboard/documentation/chart-types#word-cloud) * - [`"text"`](https://surveyjs.io/dashboard/documentation/chart-types#text-table) * - [`"choices"`](https://surveyjs.io/dashboard/documentation/chart-types#statistics-table) * - [`"nps"`](https://surveyjs.io/dashboard/documentation/chart-types#nps-visualizer) * - [`"responsecount"`](https://surveyjs.io/dashboard/documentation/chart-types#response-count) * - [`"pivot"`](https://surveyjs.io/dashboard/documentation/chart-types#pivot-chart) * * To prevent end users from changing the item type at runtime, set [`allowChangeType`](#allowChangeType) to `false`. * @since 3.0.0 */ type?: string; /** * A list of item types available for user selection. * * Refer to [`type`](#type) for supported values. * @since 3.0.0 * @see allowChangeType */ availableTypes?: string[]; /** * The item title. * @since 3.0.0 */ title?: string; /** * Specifies whether users can change the item [`type`](#type). * * Default value: `true` * @since 3.0.0 * @see availableTypes */ allowChangeType?: boolean; /** * Specifies whether this item is visible. * * Default value: `true` * @since 3.0.0 */ visible?: boolean; /** * A configuration object with visualizer settings that control how this item's data is rendered. * @since 3.0.0 */ visualizer?: { [index: string]: any; }; } /** * Visualizes an individual dashboard item. * @since 3.0.0 */ export declare class DashboardItem extends PanelElement implements IDashboardItemOptions, IVisualizerPanelRenderedElement { readonly options: IDashboardItemOptions; question?: Question; private _visualizerType; private _availableTypes; private _availableTypesOverride?; private _initialAvailableTypes?; private _type; private _dataField; private static areTypesEqual; private captureVisualizerContext; private recreateVisualizer; constructor(options: IDashboardItemOptions, question?: Question); allowChangeType?: boolean; private isQuestionWithType; private getQuestionVisualizerType; private getQuestionVisualizerTypes; private setFallbackVisualizerType; private initializeFromQuestion; private initializeFromDescriptor; private findVisualizerAndChartType; /** * Returns the currently active visualizer. * @returns The currently active visualizer. * @since 3.0.0 */ get visualizer(): VisualizerBase | undefined; private applyChartTypeToActiveVisualizer; private synchronizeTypeWithAvailableTypes; private ensureSyntheticQuestion; private getConfiguredAvailableTypes; private initTitle; private initialize; private getDataField; protected getStateProperties(): string[]; setState(elementState: any): void; getState(): any; private changeType; get visualizerType(): string; set visualizerType(value: string); visualizerTypes?: string[]; chartType?: string; questionName?: string; /** * Gets or sets the list of item types available for user selection. * * Refer to [`IDashboardItemOptions.type`](https://surveyjs.io/dashboard/documentation/api-reference/idashboarditemoptions#type) for supported values. * @since 3.0.0 */ get availableTypes(): string[]; set availableTypes(value: string[]); /** * Gets or sets the current dashboard item type. * * Refer to [`IDashboardItemOptions.type`](https://surveyjs.io/dashboard/documentation/api-reference/idashboarditemoptions#type) for supported values. * @since 3.0.0 */ get type(): string; set type(value: string); /** * Gets or sets the data field the item is bound to. * @since 3.0.0 */ get dataField(): string | undefined; set dataField(value: string | undefined); /** * Gets or sets the item title. * @since 3.0.0 */ get title(): string; set title(value: string); /** * Gets or sets item visibility. * @since 3.0.0 */ get visible(): boolean; set visible(value: boolean); }