Skip to content

Commit

Permalink
[v10.0.x] XYChart: Fix formatting of axis ticks (units, decimals) (#7…
Browse files Browse the repository at this point in the history
…0193)

XYChart: Fix formatting of axis ticks (units, decimals) (#70190)

(cherry picked from commit 9488159)

Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
  • Loading branch information
grafanabot and leeoniya committed Jun 15, 2023
1 parent e9a8bc8 commit 18303f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion public/app/plugins/panel/xychart/scatter.ts
Expand Up @@ -5,6 +5,7 @@ import {
DataFrame,
FieldColorModeId,
fieldColorModeRegistry,
formattedValueToString,
getDisplayProcessor,
getFieldColorModeForField,
getFieldDisplayName,
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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)),
});
}

Expand Down

0 comments on commit 18303f0

Please sign in to comment.