Barchart/Time series: Allow x axis label (#41142)

This commit is contained in:
Oscar Kilhed 2021-11-03 09:42:07 +01:00 committed by GitHub
parent be5dafb980
commit 43bd32206f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -79,6 +79,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<{ sync: DashboardCursor
scaleKey: xScaleKey, scaleKey: xScaleKey,
isTime: true, isTime: true,
placement: AxisPlacement.Bottom, placement: AxisPlacement.Bottom,
label: xField.config.custom?.axisLabel,
timeZone, timeZone,
theme, theme,
grid: { show: xField.config.custom?.axisGridShow }, grid: { show: xField.config.custom?.axisGridShow },
@ -98,6 +99,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<{ sync: DashboardCursor
builder.addAxis({ builder.addAxis({
scaleKey: xScaleKey, scaleKey: xScaleKey,
placement: AxisPlacement.Bottom, placement: AxisPlacement.Bottom,
label: xField.config.custom?.axisLabel,
theme, theme,
grid: { show: xField.config.custom?.axisGridShow }, grid: { show: xField.config.custom?.axisGridShow },
}); });

View File

@ -109,6 +109,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<BarChartOptions> = ({
scaleKey: 'x', scaleKey: 'x',
isTime: false, isTime: false,
placement: vizOrientation.xOri === 0 ? AxisPlacement.Bottom : AxisPlacement.Left, placement: vizOrientation.xOri === 0 ? AxisPlacement.Bottom : AxisPlacement.Left,
label: frame.fields[0].config.custom?.axisLabel,
splits: config.xSplits, splits: config.xSplits,
values: config.xValues, values: config.xValues,
grid: { show: false }, grid: { show: false },