From 04e192196cf9b5e2fb32bba6dc4c635d23ee72c0 Mon Sep 17 00:00:00 2001
From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Date: Fri, 20 Sep 2024 04:15:02 +1000
Subject: [PATCH] [8.x] [RCA] Remove x-axis and labels from library
visualizations (#192994) (#193446)
# Backport
This will backport the following commits from `main` to `8.x`:
- [[RCA] Remove x-axis and labels from library visualizations
(#192994)](https://github.com/elastic/kibana/pull/192994)
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
Co-authored-by: Bena Kansara <69037875+benakansara@users.noreply.github.com>
---
.../register_embeddable_item.tsx | 7 ++++++-
.../items/esql_item/register_esql_item.tsx | 12 ++++++++++--
.../items/lens_item/register_lens_item.tsx | 17 +++++------------
.../utils/get_lens_attrs_for_suggestion.ts | 13 -------------
4 files changed, 21 insertions(+), 28 deletions(-)
diff --git a/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx b/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx
index 3be16c83c801..8ebf3829b073 100644
--- a/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx
+++ b/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx
@@ -89,6 +89,11 @@ function LegacyEmbeddable({ type, config, timeRange: { from, to }, savedObjectId
from,
to,
},
+ overrides: {
+ axisX: { hide: true },
+ axisLeft: { style: { axisTitle: { visible: false } } },
+ settings: { showLegend: false },
+ },
};
if (savedObjectId) {
@@ -188,7 +193,7 @@ export function registerEmbeddableItem({
grow={true}
className={css`
> div {
- height: 196px;
+ height: 128px;
}
`}
>
diff --git a/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx b/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx
index 7e64db5557fc..54d3698a5148 100644
--- a/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx
+++ b/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx
@@ -132,7 +132,11 @@ export function EsqlWidget({ suggestion, dataView, esqlQuery, dateHistogramResul
);
} else {
@@ -147,7 +151,11 @@ export function EsqlWidget({ suggestion, dataView, esqlQuery, dateHistogramResul
);
diff --git a/x-pack/plugins/observability_solution/investigate_app/public/items/lens_item/register_lens_item.tsx b/x-pack/plugins/observability_solution/investigate_app/public/items/lens_item/register_lens_item.tsx
index 3f2b1d9f9c1b..2896719a49e2 100644
--- a/x-pack/plugins/observability_solution/investigate_app/public/items/lens_item/register_lens_item.tsx
+++ b/x-pack/plugins/observability_solution/investigate_app/public/items/lens_item/register_lens_item.tsx
@@ -178,17 +178,6 @@ export function LensWidget({
const attributesLens = new LensAttributesBuilder({
visualization: new XYChart({
- visualOptions: {
- axisTitlesVisibilitySettings: {
- x: false,
- yLeft: false,
- yRight: false,
- },
- legend: {
- isVisible: false,
- position: 'right',
- },
- },
layers,
formulaAPI: formulaAsync.value.formula,
dataView,
@@ -227,7 +216,11 @@ export function LensWidget({
query={(searchConfiguration?.query as Query) || defaultQuery}
disableTriggers={true}
filters={filters}
- overrides={{ axisX: { hide: true } }}
+ overrides={{
+ axisX: { hide: true },
+ axisLeft: { style: { axisTitle: { visible: false } } },
+ settings: { showLegend: false },
+ }}
/>
);
diff --git a/x-pack/plugins/observability_solution/investigate_app/public/utils/get_lens_attrs_for_suggestion.ts b/x-pack/plugins/observability_solution/investigate_app/public/utils/get_lens_attrs_for_suggestion.ts
index 79693ff2941a..0483d771954c 100644
--- a/x-pack/plugins/observability_solution/investigate_app/public/utils/get_lens_attrs_for_suggestion.ts
+++ b/x-pack/plugins/observability_solution/investigate_app/public/utils/get_lens_attrs_for_suggestion.ts
@@ -32,19 +32,6 @@ export function getLensAttrsForSuggestion({
dataView,
}) as TypedLensByValueInput['attributes'];
- attrs.state.visualization = {
- ...(attrs.state.visualization as any),
- axisTitlesVisibilitySettings: {
- x: false,
- yLeft: false,
- yRight: false,
- },
- legend: {
- isVisible: false,
- position: 'right',
- },
- };
-
const lensEmbeddableInput: TypedLensByValueInput = {
attributes: attrs,
id: v4(),