BarChart: when horiz, allow rotation and skipping of y tick labels (#59354)

This commit is contained in:
Leon Sorokin
2022-11-29 20:46:39 -06:00
committed by GitHub
parent ce0bdb2cd9
commit 122f0d947e
7 changed files with 429 additions and 67 deletions

View File

@@ -138,7 +138,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
})
.addSliderInput({
path: 'xTickLabelRotation',
name: 'Rotate bar labels',
name: 'Rotate X tick labels',
defaultValue: defaultPanelOptions.xTickLabelRotation,
settings: {
min: -90,
@@ -147,18 +147,16 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(BarChartPa
marks: { '-90': '-90°', '-45': '-45°', 0: '0°', 45: '45°', 90: '90°' },
included: false,
},
showIf: (opts) => {
return opts.orientation === VizOrientation.Auto || opts.orientation === VizOrientation.Vertical;
},
})
.addNumberInput({
path: 'xTickLabelMaxLength',
name: 'Bar label max length',
description: 'Bar labels will be truncated to the length provided',
name: 'X tick label max length',
description: 'X labels will be truncated to the length provided',
settings: {
placeholder: 'None',
min: 0,
},
showIf: (opts) => opts.xTickLabelRotation !== 0,
})
.addCustomEditor({
id: 'xTickLabelSpacing',