mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import {
|
|
OptionsWithLegend,
|
|
OptionsWithTextFormatting,
|
|
OptionsWithTooltip,
|
|
AxisConfig,
|
|
VisibilityMode,
|
|
GraphGradientMode,
|
|
HideableFieldConfig,
|
|
StackingMode,
|
|
} from '@grafana/schema';
|
|
import { VizOrientation } from '@grafana/data';
|
|
|
|
export interface PanelOptions extends OptionsWithLegend, OptionsWithTooltip, OptionsWithTextFormatting {
|
|
xField?: string;
|
|
colorByField?: string;
|
|
orientation: VizOrientation;
|
|
stacking: StackingMode;
|
|
showValue: VisibilityMode;
|
|
barWidth: number;
|
|
barRadius?: number;
|
|
groupWidth: number;
|
|
xTickLabelRotation: number;
|
|
xTickLabelMaxLength: number;
|
|
xTickLabelSpacing?: number; // negative values indicate backwards skipping behavior
|
|
}
|
|
|
|
export const defaultPanelOptions: Partial<PanelOptions> = {
|
|
stacking: StackingMode.None,
|
|
orientation: VizOrientation.Auto,
|
|
xTickLabelRotation: 0,
|
|
xTickLabelSpacing: 0,
|
|
showValue: VisibilityMode.Auto,
|
|
groupWidth: 0.7,
|
|
barWidth: 0.97,
|
|
barRadius: 0,
|
|
};
|
|
|
|
export interface BarChartFieldConfig extends AxisConfig, HideableFieldConfig {
|
|
lineWidth?: number; // 0
|
|
fillOpacity?: number; // 100
|
|
gradientMode?: GraphGradientMode;
|
|
}
|
|
|
|
export const defaultBarChartFieldConfig: BarChartFieldConfig = {
|
|
lineWidth: 1,
|
|
fillOpacity: 80,
|
|
gradientMode: GraphGradientMode.None,
|
|
};
|