diff --git a/src/plugins/vis_type_xy/public/components/xy_settings.tsx b/src/plugins/vis_type_xy/public/components/xy_settings.tsx
index 8922f512522a04..8d6a7eecdfe522 100644
--- a/src/plugins/vis_type_xy/public/components/xy_settings.tsx
+++ b/src/plugins/vis_type_xy/public/components/xy_settings.tsx
@@ -29,7 +29,6 @@ import { renderEndzoneTooltip } from '../../../charts/public';
import { getThemeService, getUISettings } from '../services';
import { VisConfig } from '../types';
-import { fillEmptyValue } from '../utils/get_series_name_fn';
declare global {
interface Window {
@@ -134,7 +133,7 @@ export const XYSettings: FC = ({
};
const headerValueFormatter: TickFormatter | undefined = xAxis.ticks?.formatter
- ? (value) => fillEmptyValue(xAxis.ticks?.formatter?.(value)) ?? ''
+ ? (value) => xAxis.ticks?.formatter?.(value) ?? ''
: undefined;
const headerFormatter =
isTimeChart && xDomain && adjustedXDomain
diff --git a/src/plugins/vis_type_xy/public/config/get_axis.ts b/src/plugins/vis_type_xy/public/config/get_axis.ts
index 08b17c882eea6b..71d33cc20d057f 100644
--- a/src/plugins/vis_type_xy/public/config/get_axis.ts
+++ b/src/plugins/vis_type_xy/public/config/get_axis.ts
@@ -27,7 +27,6 @@ import {
YScaleType,
SeriesParam,
} from '../types';
-import { fillEmptyValue } from '../utils/get_series_name_fn';
export function getAxis(
{ type, title: axisTitle, labels, scale: axisScale, ...axis }: CategoryAxis,
@@ -90,8 +89,7 @@ function getLabelFormatter(
}
return (value: any) => {
- const formattedStringValue = `${formatter ? formatter(value) : value}`;
- const finalValue = fillEmptyValue(formattedStringValue);
+ const finalValue = `${formatter ? formatter(value) : value}`;
if (finalValue.length > truncate) {
return `${finalValue.slice(0, truncate)}...`;
diff --git a/src/plugins/vis_type_xy/public/plugin.ts b/src/plugins/vis_type_xy/public/plugin.ts
index e8d53127765b4c..b595d3172f143e 100644
--- a/src/plugins/vis_type_xy/public/plugin.ts
+++ b/src/plugins/vis_type_xy/public/plugin.ts
@@ -23,7 +23,7 @@ import {
} from './services';
import { visTypesDefinitions } from './vis_types';
-import { LEGACY_CHARTS_LIBRARY } from '../../visualizations/common/constants';
+import { LEGACY_CHARTS_LIBRARY } from '../common/';
import { xyVisRenderer } from './vis_renderer';
import * as expressionFunctions from './expression_functions';
diff --git a/src/plugins/vis_type_xy/public/utils/get_series_name_fn.ts b/src/plugins/vis_type_xy/public/utils/get_series_name_fn.ts
index 0e54650e22f750..137f8a55580101 100644
--- a/src/plugins/vis_type_xy/public/utils/get_series_name_fn.ts
+++ b/src/plugins/vis_type_xy/public/utils/get_series_name_fn.ts
@@ -8,21 +8,10 @@
import { memoize } from 'lodash';
-import { i18n } from '@kbn/i18n';
import { XYChartSeriesIdentifier, SeriesName } from '@elastic/charts';
import { VisConfig } from '../types';
-const emptyTextLabel = i18n.translate('visTypeXy.emptyTextColumnValue', {
- defaultMessage: '(empty)',
-});
-
-/**
- * Returns empty values
- */
-export const fillEmptyValue = (value: T) =>
- value === '' ? emptyTextLabel : value;
-
function getSplitValues(
splitAccessors: XYChartSeriesIdentifier['splitAccessors'],
seriesAspects?: VisConfig['aspects']['series']
@@ -36,7 +25,7 @@ function getSplitValues(
const split = (seriesAspects ?? []).find(({ accessor }) => accessor === key);
splitValues.push(split?.formatter ? split?.formatter(value) : value);
});
- return splitValues.map(fillEmptyValue);
+ return splitValues;
}
export const getSeriesNameFn = (aspects: VisConfig['aspects'], multipleY = false) =>
diff --git a/src/plugins/vis_type_xy/server/index.ts b/src/plugins/vis_type_xy/server/index.ts
new file mode 100644
index 00000000000000..a27ac49c0ea490
--- /dev/null
+++ b/src/plugins/vis_type_xy/server/index.ts
@@ -0,0 +1,10 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+import { VisTypeXyServerPlugin } from './plugin';
+
+export const plugin = () => new VisTypeXyServerPlugin();
diff --git a/src/plugins/vis_type_xy/server/plugin.ts b/src/plugins/vis_type_xy/server/plugin.ts
new file mode 100644
index 00000000000000..46d6531204c241
--- /dev/null
+++ b/src/plugins/vis_type_xy/server/plugin.ts
@@ -0,0 +1,56 @@
+/*
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
+ * or more contributor license agreements. Licensed under the Elastic License
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
+ * Side Public License, v 1.
+ */
+
+import { i18n } from '@kbn/i18n';
+import { schema } from '@kbn/config-schema';
+
+import { CoreSetup, Plugin, UiSettingsParams } from 'kibana/server';
+
+import { LEGACY_CHARTS_LIBRARY } from '../common';
+
+export const getUiSettingsConfig: () => Record> = () => ({
+ // TODO: Remove this when vis_type_vislib is removed
+ // https://github.com/elastic/kibana/issues/56143
+ [LEGACY_CHARTS_LIBRARY]: {
+ name: i18n.translate('visTypeXy.advancedSettings.visualization.legacyChartsLibrary.name', {
+ defaultMessage: 'XY axis legacy charts library',
+ }),
+ requiresPageReload: true,
+ value: false,
+ description: i18n.translate(
+ 'visTypeXy.advancedSettings.visualization.legacyChartsLibrary.description',
+ {
+ defaultMessage: 'Enables legacy charts library for area, line and bar charts in visualize.',
+ }
+ ),
+ deprecation: {
+ message: i18n.translate(
+ 'visTypeXy.advancedSettings.visualization.legacyChartsLibrary.deprecation',
+ {
+ defaultMessage:
+ 'The legacy charts library for area, line and bar charts in visualize is deprecated and will not be supported as of 7.16.',
+ }
+ ),
+ docLinksKey: 'visualizationSettings',
+ },
+ category: ['visualization'],
+ schema: schema.boolean(),
+ },
+});
+
+export class VisTypeXyServerPlugin implements Plugin |