From ab2a46bcb35e92244351cb895331dfa83c9a7ced Mon Sep 17 00:00:00 2001 From: Piotr G Date: Wed, 18 Nov 2020 18:38:57 +0100 Subject: [PATCH] Gauge: Tweaks short value auto-sizing (#29197) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Tweaks gauge value auto-sizing * tweak factor a bit Co-authored-by: Torkel Ödegaard --- packages/grafana-ui/src/components/Gauge/Gauge.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grafana-ui/src/components/Gauge/Gauge.tsx b/packages/grafana-ui/src/components/Gauge/Gauge.tsx index 7ad6add7c19..2e98f8f7cd0 100644 --- a/packages/grafana-ui/src/components/Gauge/Gauge.tsx +++ b/packages/grafana-ui/src/components/Gauge/Gauge.tsx @@ -108,7 +108,7 @@ export class Gauge extends PureComponent { // remove gauge & marker width (on left and right side) // and 10px is some padding that flot adds to the outer canvas const valueWidth = valueWidthBase - ((gaugeWidth + (showThresholdMarkers ? thresholdMarkersWidth : 0)) * 2 + 10); - const fontSize = calculateFontSize(text, valueWidth, dimension, 1, 48); + const fontSize = calculateFontSize(text, valueWidth, dimension, 1, gaugeWidth * 1.7); const thresholdLabelFontSize = fontSize / 2.5; let min = field.min!;