TimeSeries: Expose option for "Bar width factor" (#77338)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
This commit is contained in:
Sebastian Hiebl 2024-06-29 01:13:34 +02:00 committed by GitHub
parent c2cd32ab64
commit 8008bcd003
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 0 deletions

View File

@ -123,6 +123,10 @@ Set the position of the bar relative to a data point. In the examples below, **S
- **After** ![Bar alignment after icon](/static/img/docs/time-series-panel/bar-alignment-after.png)
The bar is drawn after the point. The point is placed on the leading corner of the bar.
### Bar width factor
Set the width of the bar relative to minimum space between data points. A factor of 0.5 means that the bars take up half of the available space between data points. A factor of 1.0 means that the bars take up all available space.
### Line width
Line width is a slider that controls the thickness for series lines or the outline for bars.

View File

@ -32,6 +32,7 @@ export const defaultGraphConfig: GraphFieldConfig = {
fillOpacity: 0,
gradientMode: GraphGradientMode.None,
barAlignment: BarAlignment.Center,
barWidthFactor: 0.6,
stacking: {
mode: StackingMode.None,
group: 'A',
@ -90,6 +91,19 @@ export function getGraphFieldConfig(cfg: GraphFieldConfig, isTime = true): SetFi
},
showIf: (config) => config.drawStyle === GraphDrawStyle.Bars,
})
.addSliderInput({
path: 'barWidthFactor',
name: 'Bar width factor',
category: categoryStyles,
defaultValue: cfg.barWidthFactor,
settings: {
min: 0.1,
max: 1.0,
step: 0.1,
ariaLabelForHandle: 'Bar width factor',
},
showIf: (config) => config.drawStyle === GraphDrawStyle.Bars,
})
.addSliderInput({
path: 'lineWidth',
name: 'Line width',