Skip to content

[Lens as Code] Legend truncation options are ignored #258202

@nickofthyme

Description

@nickofthyme

In multiple chart transforms (i.e. xy, heatmap) we have logic to encode the legend truncation properties. The old config allowed users to set the shouldTruncate to false while also providing a maxLines property greater than 0.

truncate_after_lines: legend?.maxLines == null ? undefined : legend.maxLines,

However, in the new api format we created a simpler way to define this with just the single truncate_after_lines property.

shouldTruncate: Boolean(legend?.truncate_after_lines), // 0 will be interpreted as false

The current logic when shouldTruncate === false and maxLines > 0 results in truncate_after_lines being set to the value of maxLines which on a full round trip, with result in shouldTruncate being set to true.

We need to check shouldTruncate before setting the value of truncate_after_lines.

Metadata

Metadata

Assignees

Labels

Feature:LensTeam:VisualizationsTeam label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t//bugFixes for quality problems that affect the customer experience

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions