From 5282b7ca8c96eded59c17142be6b48a8196f9b33 Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Mon, 13 Jan 2025 09:21:17 +0100 Subject: [PATCH] Bugfix: Updating storybook example to pass theme property to BarGuage (#98804) * Updating storybook example and making sure BarGauage has theme setup. * removed unneccessary theme. * Reverted change updated example. --- .../src/components/BarGauge/BarGauge.mdx | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/packages/grafana-ui/src/components/BarGauge/BarGauge.mdx b/packages/grafana-ui/src/components/BarGauge/BarGauge.mdx index 5d802727f4f..c1902079cfe 100644 --- a/packages/grafana-ui/src/components/BarGauge/BarGauge.mdx +++ b/packages/grafana-ui/src/components/BarGauge/BarGauge.mdx @@ -14,34 +14,35 @@ import { VizOrientation, ThresholdsMode, Field, FieldType, getDisplayProcessor } const field: Partial = { type: FieldType.number, config: { - min: minValue, - max: maxValue, + min: 0, + max: 100, thresholds: { mode: ThresholdsMode.Absolute, steps: [ { value: -Infinity, color: 'green' }, - { value: threshold1Value, color: threshold1Color }, - { value: threshold2Value, color: threshold2Color }, + { value: 20, color: 'blue' }, + { value: 90, color: 'red' }, ], }, }, }; -field.display = getDisplayProcessor({ field }); -const value = { - text: value.toString(), - title: title, - numeric: value, -}; +field.display = getDisplayProcessor({ theme, field }); -; +return ( + +); ```