From 2cfcb8caf938c3630474f0fc7c161597168dbd67 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Sat, 30 Oct 2021 16:51:55 +0200 Subject: [PATCH] [ML] Fix y axis ticks. (#116670) Fixes the y axis ticks for chart variants where the maximum transaction count for overall buckets is only 1. --- .../shared/charts/transaction_distribution_chart/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx b/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx index 1a1ea13fa45ec0..dcf52cebaeedac 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/transaction_distribution_chart/index.tsx @@ -132,7 +132,7 @@ export function TransactionDistributionChart({ Math.max( ...flatten(data.map((d) => d.histogram)).map((d) => d.doc_count) ) ?? 0; - const yTicks = Math.ceil(Math.log10(yMax)); + const yTicks = Math.max(1, Math.ceil(Math.log10(yMax))); const yAxisDomain = { min: 0.5, max: Math.pow(10, yTicks),