Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v10.0.x] XYChart: Fix formatting of axis ticks (units, decimals) #70193

Merged
merged 1 commit into from Jun 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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