Timeseries: migrate log scale (#37771)

This commit is contained in:
Ryan McKinley 2021-08-11 00:23:12 -07:00 committed by GitHub
parent 31bb3522c8
commit 7a8e861c1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -489,6 +489,10 @@ Object {
"fill": "dash",
},
"lineWidth": 1,
"scaleDistribution": Object {
"log": 10,
"type": "log",
},
"showPoints": "never",
"spanNulls": true,
},

View File

@ -632,7 +632,7 @@ const stepedColordLine = {
$$hashKey: 'object:39',
format: 'short',
label: null,
logBase: 1,
logBase: 10,
max: null,
min: null,
show: true,

View File

@ -22,6 +22,7 @@ import {
LineInterpolation,
LineStyle,
PointVisibility,
ScaleDistribution,
StackingMode,
TooltipDisplayMode,
} from '@grafana/ui';
@ -467,6 +468,15 @@ function getFieldConfigFromOldAxis(obj: any): FieldConfig<GraphFieldConfig> {
if (obj.label) {
graph.axisLabel = obj.label;
}
if (obj.logBase) {
const log = obj.logBase as number;
if (log === 2 || log === 10) {
graph.scaleDistribution = {
type: ScaleDistribution.Log,
log,
};
}
}
return omitBy(
{
unit: obj.format,