From 18303f09b3ab15eed5c03d5457e8baa85a5504e4 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 15 Jun 2023 12:46:42 -0400 Subject: [PATCH] [v10.0.x] XYChart: Fix formatting of axis ticks (units, decimals) (#70193) XYChart: Fix formatting of axis ticks (units, decimals) (#70190) (cherry picked from commit 94881597d8132f806bfe1bee71eeacae44d791ce) Co-authored-by: Leon Sorokin --- public/app/plugins/panel/xychart/scatter.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/xychart/scatter.ts b/public/app/plugins/panel/xychart/scatter.ts index c312cd42dea..5d335eaf6b5 100644 --- a/public/app/plugins/panel/xychart/scatter.ts +++ b/public/app/plugins/panel/xychart/scatter.ts @@ -5,6 +5,7 @@ import { DataFrame, FieldColorModeId, fieldColorModeRegistry, + formattedValueToString, getDisplayProcessor, getFieldColorModeForField, getFieldDisplayName, @@ -620,6 +621,7 @@ const prepConfig = ( xAxisLabel == null || xAxisLabel === '' ? getFieldDisplayName(xField, scatterSeries[0].frame(frames), frames) : xAxisLabel, + formatValue: (v, decimals) => formattedValueToString(xField.display!(v, decimals)), }); scatterSeries.forEach((s, si) => { @@ -653,7 +655,7 @@ const prepConfig = ( yAxisLabel == null || yAxisLabel === '' ? getFieldDisplayName(field, scatterSeries[si].frame(frames), frames) : yAxisLabel, - values: (u, splits) => splits.map((s) => field.display!(s).text), + formatValue: (v, decimals) => formattedValueToString(field.display!(v, decimals)), }); }