Skip to content

Commit

Permalink
[8.x] [RCA] Remove x-axis and labels from library visualizations (#19…
Browse files Browse the repository at this point in the history
…2994) (#193446)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[RCA] Remove x-axis and labels from library visualizations
(#192994)](#192994)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Bena
Kansara","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-09-16T20:26:52Z","message":"[RCA]
Remove x-axis and labels from library visualizations
(#192994)\n\nRemoves y-axis label, x-axis and adjusts height of the
component for\r\nlibrary
visualizations","sha":"bcab410c5006e49a37f5eddd5230a6b74593c2d7","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","auto-backport","ci:project-deploy-observability","Team:obs-ux-management","v8.16.0","backport:version"],"title":"[RCA]
Remove x-axis and labels from library
visualizations","number":192994,"url":"https://github.com/elastic/kibana/pull/192994","mergeCommit":{"message":"[RCA]
Remove x-axis and labels from library visualizations
(#192994)\n\nRemoves y-axis label, x-axis and adjusts height of the
component for\r\nlibrary
visualizations","sha":"bcab410c5006e49a37f5eddd5230a6b74593c2d7"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192994","number":192994,"mergeCommit":{"message":"[RCA]
Remove x-axis and labels from library visualizations
(#192994)\n\nRemoves y-axis label, x-axis and adjusts height of the
component for\r\nlibrary
visualizations","sha":"bcab410c5006e49a37f5eddd5230a6b74593c2d7"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Bena Kansara <[email protected]>
  • Loading branch information
kibanamachine and benakansara authored Sep 19, 2024
1 parent 446d593 commit 04e1921
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -188,7 +193,7 @@ export function registerEmbeddableItem({
grow={true}
className={css`
> div {
height: 196px;
height: 128px;
}
`}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ export function EsqlWidget({ suggestion, dataView, esqlQuery, dateHistogramResul
<lens.EmbeddableComponent
{...previewInput.value}
style={{ height: 128 }}
overrides={{ axisX: { hide: true } }}
overrides={{
axisX: { hide: true },
axisLeft: { style: { axisTitle: { visible: false } } },
settings: { showLegend: false },
}}
/>
);
} else {
Expand All @@ -147,7 +151,11 @@ export function EsqlWidget({ suggestion, dataView, esqlQuery, dateHistogramResul
<lens.EmbeddableComponent
{...input}
style={{ height: 128 }}
overrides={{ axisX: { hide: true } }}
overrides={{
axisX: { hide: true },
axisLeft: { style: { axisTitle: { visible: false } } },
settings: { showLegend: false },
}}
/>
</EuiFlexItem>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 },
}}
/>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 04e1921

Please sign in to comment.