TimeSeries/Barchart: Only show default label for y axis (#44713)

* TimeSeries/Barchart: only show default label for x axis

* Update docs

* Update packages/grafana-ui/src/options/builder/axis.tsx

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
This commit is contained in:
Oscar Kilhed 2022-02-02 11:05:48 +01:00 committed by GitHub
parent 69e4796504
commit 78ed5a99e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ Set a Y-axis text label.
![Label example](/static/img/docs/time-series-panel/label-example-7-4.png)
If you have more than one Y-axis, then you can give assign different labels in the Override tab.
If you have more than one Y-axis, then you can give assign different labels in the Override tab. You can also set the X-axis label using an override.
## Width

View File

@ -37,8 +37,8 @@ export function addAxisConfig(
placeholder: 'Optional text',
},
showIf: (c) => c.axisPlacement !== AxisPlacement.Hidden,
// no matter what the field type is
shouldApply: () => true,
// Do not apply default settings to time and string fields which are used as x-axis fields in Time series and Bar chart panels
shouldApply: (f) => f.type !== FieldType.time && f.type !== FieldType.string,
})
.addNumberInput({
path: 'axisWidth',