mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Time series panel: Hide axis when series is hidden from the visualization (#51432)
* Time series panel: Hide axis when series is hidden from the visualization * Fix snap
This commit is contained in:
@@ -41,8 +41,8 @@ Object {
|
||||
},
|
||||
"labelGap": 0,
|
||||
"rotate": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"show": true,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": false,
|
||||
"side": 3,
|
||||
"size": [Function],
|
||||
"space": [Function],
|
||||
@@ -79,7 +79,7 @@ Object {
|
||||
"key": "__global_",
|
||||
"scales": Array [
|
||||
"x",
|
||||
"__fixed/na-na/na-na/auto/linear/na",
|
||||
"__fixed/na-na/na-na/auto/linear/na/false",
|
||||
],
|
||||
},
|
||||
},
|
||||
@@ -87,7 +87,7 @@ Object {
|
||||
"mode": 1,
|
||||
"padding": undefined,
|
||||
"scales": Object {
|
||||
"__fixed/na-na/na-na/auto/linear/na": Object {
|
||||
"__fixed/na-na/na-na/auto/linear/na/false": Object {
|
||||
"auto": true,
|
||||
"dir": 1,
|
||||
"distr": 1,
|
||||
@@ -125,7 +125,7 @@ Object {
|
||||
"stroke": "#ff0000",
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
@@ -148,7 +148,7 @@ Object {
|
||||
"stroke": "#ff0000",
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
@@ -171,7 +171,7 @@ Object {
|
||||
"stroke": "#ff0000",
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
@@ -194,7 +194,7 @@ Object {
|
||||
"stroke": "#ff0000",
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
@@ -217,7 +217,7 @@ Object {
|
||||
"stroke": "#ff0000",
|
||||
},
|
||||
"pxAlign": undefined,
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na",
|
||||
"scale": "__fixed/na-na/na-na/auto/linear/na/false",
|
||||
"show": true,
|
||||
"spanGaps": false,
|
||||
"stroke": "#ff0000",
|
||||
|
||||
@@ -151,7 +151,9 @@ export function buildScaleKey(config: FieldConfig<GraphFieldConfig>) {
|
||||
|
||||
const scaleLabel = Boolean(config.custom?.axisLabel) ? config.custom!.axisLabel : defaultPart;
|
||||
|
||||
return `${scaleUnit}/${scaleRange}/${scaleSoftRange}/${scalePlacement}/${scaleDistribution}/${scaleLabel}`;
|
||||
const shouldHideFromViz = Boolean(config.custom?.hideFrom?.viz);
|
||||
|
||||
return `${scaleUnit}/${scaleRange}/${scaleSoftRange}/${scalePlacement}/${scaleDistribution}/${scaleLabel}/${shouldHideFromViz}`;
|
||||
}
|
||||
|
||||
function getScaleDistributionPart(config: ScaleDistributionConfig) {
|
||||
|
||||
@@ -201,6 +201,7 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn<{
|
||||
formatValue: (v) => formattedValueToString(fmt(v)),
|
||||
theme,
|
||||
grid: { show: customConfig.axisGridShow },
|
||||
show: customConfig.hideFrom?.viz === false,
|
||||
},
|
||||
field
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user