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.
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
shouldTruncatetofalsewhile also providing amaxLinesproperty greater than0.kibana/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/transforms/charts/xy/legend.ts
Line 187 in 77e5489
However, in the new api format we created a simpler way to define this with just the single
truncate_after_linesproperty.kibana/src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/transforms/charts/xy/legend.ts
Line 105 in 77e5489
The current logic when
shouldTruncate === falseandmaxLines > 0results intruncate_after_linesbeing set to the value ofmaxLineswhich on a full round trip, with result inshouldTruncatebeing set totrue.We need to check
shouldTruncatebefore setting the value oftruncate_after_lines.