diff --git a/packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts b/packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts index a0a18d379b60a..85e7c4ad5375c 100644 --- a/packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts +++ b/packages/kbn-visualization-utils/src/map_vis_to_chart_type.ts @@ -10,28 +10,19 @@ import { ChartType, LensVisualizationType } from './types'; export const mapVisToChartType = (visualizationType: string) => { - let chartType: ChartType | undefined; - switch (visualizationType) { case LensVisualizationType.XY: - chartType = ChartType.XY; - break; + return ChartType.XY; case LensVisualizationType.Metric: - chartType = ChartType.Metric; - break; + case LensVisualizationType.LegacyMetric: + return ChartType.Metric; case LensVisualizationType.Pie: - chartType = ChartType.Pie; - break; + return ChartType.Pie; case LensVisualizationType.Heatmap: - chartType = ChartType.Heatmap; - break; + return ChartType.Heatmap; + case LensVisualizationType.Gauge: + return ChartType.Gauge; case LensVisualizationType.Datatable: - chartType = ChartType.Table; - break; - case LensVisualizationType.LegacyMetric: - chartType = ChartType.Metric; - break; + return ChartType.Table; } - - return chartType; };