import type { StylingProps, MaskingProps, DataTestId } from '@dynatrace/strato-components/core'; import type { FormatOptions, Unit, ConvertibleUnit } from '@dynatrace-sdk/units'; import type { Formatter } from '../../../core/types/formatter.js'; import type { MeterBarSize } from '../../shared/types/meter-bars.js'; /** * Information hold by the meter bar chart * @public */ export type MeterBarSegmentData = { id: string; name: string; values: string[]; }; /** * @public */ export interface MeterBarChartProps extends StylingProps, MaskingProps, DataTestId { /** * Value of the meter bar segment */ value: number; /** * Min value for the meter bar chart scale. * @defaultValue 0 */ min?: number; /** * Max value for the meter bar chart scale. * @defaultValue 100 */ max?: number; /** * Color of the meter bar segment. If not provided, it will display a default color. * @defaultValue 'Categorical.Color11' */ color?: string; /** * The size that applies to the value, icon, and label. * @defaultValue 'size16' */ size?: MeterBarSize; /** * Segment name. If not provided, it will display a default name. * @defaultValue 'value' */ name?: string; /** * Custom Formatter for the chart */ formatter?: Formatter | FormatOptions; /** Exposed callback to display series actions */ seriesActions?: (seriesData: MeterBarSegmentData) => React.ReactElement; } /** * @public */ export interface MeterBarChartThresholdProps { /** * Name of the threshold displayed in the threshold legend. */ name?: string; /** * The color of the threshold. * @defaultValue 'Categorical.Color11' */ color?: string; /** * The value of the threshold. */ value: number; /** * When set to true, it shows the indicator of the threshold. * @defaultValue false */ showIndicator?: boolean; }