diff --git a/packages/grafana-ui/src/components/RadialGauge/RadialGauge.tsx b/packages/grafana-ui/src/components/RadialGauge/RadialGauge.tsx index e1d6b7eee2f..128c56b1cb6 100644 --- a/packages/grafana-ui/src/components/RadialGauge/RadialGauge.tsx +++ b/packages/grafana-ui/src/components/RadialGauge/RadialGauge.tsx @@ -293,10 +293,6 @@ function getStyles(theme: GrafanaTheme2) { display: 'flex', justifyContent: 'center', alignItems: 'center', - // Adds subtle shadow in light themes to help bar stand out - '.radial-arc-path': { - filter: theme.isLight ? `drop-shadow(0px 0px 1px #888);` : '', - }, }), clearButton: css({ background: 'transparent', diff --git a/public/app/plugins/panel/radialbar/GaugeMigrations.ts b/public/app/plugins/panel/radialbar/GaugeMigrations.ts index 0a3baf9770e..40b291233d2 100644 --- a/public/app/plugins/panel/radialbar/GaugeMigrations.ts +++ b/public/app/plugins/panel/radialbar/GaugeMigrations.ts @@ -20,6 +20,7 @@ export function gaugePanelMigrationHandler(panel: PanelModel): Partial< // This option is enabled by default in new gauge but does not exist in old gauge newOptions.sparkline = false; + newOptions.gradient = 'none'; // Remove deprecated sizing options if ('sizing' in newOptions) { diff --git a/public/app/plugins/panel/radialbar/module.tsx b/public/app/plugins/panel/radialbar/module.tsx index 4bc4e62b96a..9667f6fb714 100644 --- a/public/app/plugins/panel/radialbar/module.tsx +++ b/public/app/plugins/panel/radialbar/module.tsx @@ -35,7 +35,7 @@ export const plugin = new PanelPlugin(RadialBarPanel) path: 'gradient', name: t('radialbar.config.gradient', 'Gradient'), category, - defaultValue: 'none', + defaultValue: defaultOptions.gradient, settings: { options: [ { value: 'none', label: t('radialbar.config.gradient-none', 'None') }, diff --git a/public/app/plugins/panel/radialbar/suggestions.ts b/public/app/plugins/panel/radialbar/suggestions.ts index 31f2f6e610e..468451be9f6 100644 --- a/public/app/plugins/panel/radialbar/suggestions.ts +++ b/public/app/plugins/panel/radialbar/suggestions.ts @@ -1,4 +1,5 @@ import { VisualizationSuggestionsBuilder } from '@grafana/data'; +import { FieldColorModeId } from '@grafana/schema/dist/esm/index.gen'; import { SuggestionName } from 'app/types/suggestions'; import { Options } from './panelcfg.gen'; @@ -12,7 +13,7 @@ export class GaugeSuggestionsSupplier { } // for many fields / series this is probably not a good fit - if (dataSummary.numberFieldCount >= 50) { + if (dataSummary.numberFieldCount >= 10) { return; } @@ -35,7 +36,7 @@ export class GaugeSuggestionsSupplier { if (dataSummary.hasStringField && dataSummary.frameCount === 1 && dataSummary.rowCountTotal < 10) { list.append({ - name: SuggestionName.RadialBar, + name: SuggestionName.Gauge, options: { reduceOptions: { values: true, @@ -43,9 +44,26 @@ export class GaugeSuggestionsSupplier { }, }, }); + list.append({ + name: SuggestionName.GaugeCircular, + options: { + shape: 'circle', + showThresholdMarkers: false, + reduceOptions: { + values: true, + calcs: [], + }, + }, + fieldConfig: { + defaults: { + color: { mode: FieldColorModeId.PaletteClassic }, + }, + overrides: [], + }, + }); } else { list.append({ - name: SuggestionName.RadialBar, + name: SuggestionName.Gauge, options: { reduceOptions: { values: false, @@ -53,6 +71,30 @@ export class GaugeSuggestionsSupplier { }, }, }); + list.append({ + name: SuggestionName.GaugeCircular, + options: { + shape: 'circle', + showThresholdMarkers: false, + barWidthFactor: 0.3, + effects: { + rounded: true, + barGlow: true, + centerGlow: true, + spotlight: true, + }, + reduceOptions: { + values: false, + calcs: ['lastNotNull'], + }, + }, + fieldConfig: { + defaults: { + color: { mode: FieldColorModeId.PaletteClassic }, + }, + overrides: [], + }, + }); } } } diff --git a/public/app/types/suggestions.ts b/public/app/types/suggestions.ts index beea4ecb59c..aac0dc1bd3c 100644 --- a/public/app/types/suggestions.ts +++ b/public/app/types/suggestions.ts @@ -18,8 +18,8 @@ export enum SuggestionName { Stat = 'Stat', StatColoredBackground = 'Stat colored background', Gauge = 'Gauge', + GaugeCircular = 'Circular gauge', GaugeNoThresholds = 'Gauge no thresholds', - RadialBar = 'Radial bar', BarGaugeBasic = 'Bar gauge basic', BarGaugeLCD = 'Bar gauge LCD', Table = 'Table',