BarChart: show x tick picker (#43510)

This commit is contained in:
Ryan McKinley
2022-01-10 15:12:33 -08:00
committed by GitHub
parent 5e7804f466
commit 6b70e1af76
3 changed files with 72 additions and 15 deletions

View File

@@ -14,6 +14,7 @@ import { BarChartFieldConfig, PanelOptions, defaultBarChartFieldConfig, defaultP
import { BarChartSuggestionsSupplier } from './suggestions';
import { prepareBarChartDisplayValues } from './utils';
import { config } from '@grafana/runtime';
import { TickSpacingEditor } from './TickSpacingEditor';
export const plugin = new PanelPlugin<PanelOptions, BarChartFieldConfig>(BarChartPanel)
.useFieldConfig({
@@ -113,23 +114,17 @@ export const plugin = new PanelPlugin<PanelOptions, BarChartFieldConfig>(BarChar
name: 'Bar label max length',
description: 'Bar labels will be truncated to the length provided',
settings: {
placeholder: 'Auto',
placeholder: 'None',
min: 0,
},
})
// .addSliderInput({
// path: 'xTickLabelSpacing',
// name: 'Bar label minimum spacing',
// description: 'Bar labels will be skipped to maintain this distance',
// defaultValue: 0,
// settings: {
// min: -300,
// max: 300,
// step: 10,
// marks: { '-300': 'Backward', 0: 'None', 300: 'Forward' },
// included: false,
// },
// })
.addCustomEditor({
id: 'xTickLabelSpacing',
path: 'xTickLabelSpacing',
name: 'Bar labels minimum spacing',
defaultValue: defaultPanelOptions.xTickLabelSpacing,
editor: TickSpacingEditor,
})
.addRadio({
path: 'showValue',
name: 'Show values',