kibana/x-pack/plugins/lens/common
Nick Partridge 5614d09131
[8.16] [Lens] Restore dynamic colouring by value for Last value agg (#209110) (#210879)
# Backport

This will backport the following commits from `main` to `8.16`:
- [[Lens] Restore dynamic colouring by value for Last value agg
(#209110)](https://github.com/elastic/kibana/pull/209110)

<!--- Backport version: 9.6.4 -->

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

<!--BACKPORT [{"author":{"name":"Marco
Liberati","email":"dej611@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-02-11T14:55:35Z","message":"[Lens]
Restore dynamic colouring by value for Last value agg (#209110)\n\n##
Summary\n\nFixes #208924\n\nThis PR improves the numeric check for the
Last value agg within the\nMetric chart type avoiding completely to
access the active data and\nrather rely on the datasource
configuration.\nThe new utility function in fact won't rely any more on
active data\nrather on the Lens configuration itself, which is more
robust, faster\nand flexible.\n\n<img width=\"2552\" alt=\"Screenshot
2025-01-31 at 14 30
12\"\nsrc=\"https://github.com/user-attachments/assets/5f8792db-40ff-497b-8e2f-0737c2932f92\"\n/>\n\n\n###
Notes for testing\n\nI've created a testing dashboard with all the
possible combinations of\ncolouring for metric and
tables.\n\n\n[last_value_dashboard.ndjson.txt](https://github.com/user-attachments/files/18618905/last_value_dashboard.ndjson.txt)\n\n\n###
Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n## Release
note\n\nThis fixes an issue where dynamic colouring has been disabled
from Last\nvalue aggregation
types.","sha":"abba6675e29b28b91daea1f46d2ff48363ab78ab","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","Feature:Lens","backport
missing","backport:prev-major","v9.1.0"],"title":"[Lens] Restore dynamic
colouring by value for Last value
agg","number":209110,"url":"https://github.com/elastic/kibana/pull/209110","mergeCommit":{"message":"[Lens]
Restore dynamic colouring by value for Last value agg (#209110)\n\n##
Summary\n\nFixes #208924\n\nThis PR improves the numeric check for the
Last value agg within the\nMetric chart type avoiding completely to
access the active data and\nrather rely on the datasource
configuration.\nThe new utility function in fact won't rely any more on
active data\nrather on the Lens configuration itself, which is more
robust, faster\nand flexible.\n\n<img width=\"2552\" alt=\"Screenshot
2025-01-31 at 14 30
12\"\nsrc=\"https://github.com/user-attachments/assets/5f8792db-40ff-497b-8e2f-0737c2932f92\"\n/>\n\n\n###
Notes for testing\n\nI've created a testing dashboard with all the
possible combinations of\ncolouring for metric and
tables.\n\n\n[last_value_dashboard.ndjson.txt](https://github.com/user-attachments/files/18618905/last_value_dashboard.ndjson.txt)\n\n\n###
Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n## Release
note\n\nThis fixes an issue where dynamic colouring has been disabled
from Last\nvalue aggregation
types.","sha":"abba6675e29b28b91daea1f46d2ff48363ab78ab"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/209110","number":209110,"mergeCommit":{"message":"[Lens]
Restore dynamic colouring by value for Last value agg (#209110)\n\n##
Summary\n\nFixes #208924\n\nThis PR improves the numeric check for the
Last value agg within the\nMetric chart type avoiding completely to
access the active data and\nrather rely on the datasource
configuration.\nThe new utility function in fact won't rely any more on
active data\nrather on the Lens configuration itself, which is more
robust, faster\nand flexible.\n\n<img width=\"2552\" alt=\"Screenshot
2025-01-31 at 14 30
12\"\nsrc=\"https://github.com/user-attachments/assets/5f8792db-40ff-497b-8e2f-0737c2932f92\"\n/>\n\n\n###
Notes for testing\n\nI've created a testing dashboard with all the
possible combinations of\ncolouring for metric and
tables.\n\n\n[last_value_dashboard.ndjson.txt](https://github.com/user-attachments/files/18618905/last_value_dashboard.ndjson.txt)\n\n\n###
Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n\n## Release
note\n\nThis fixes an issue where dynamic colouring has been disabled
from Last\nvalue aggregation
types.","sha":"abba6675e29b28b91daea1f46d2ff48363ab78ab"}}]}]
BACKPORT-->

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
2025-02-12 19:19:36 +01:00
..
content_management [Move @kbn/config-schema to server] visualization plugins (#191775) 2024-08-30 14:37:29 +02:00
embeddable_factory [Lens] [metric visualization] a column normalized by unit doesn't display properly on dashboard (#142741) 2022-10-06 10:54:56 +03:00
expressions [8.16] [Lens] Restore dynamic colouring by value for Last value agg (#209110) (#210879) 2025-02-12 19:19:36 +01:00
locator [Lens] Share link feature (#148829) 2023-01-18 18:05:26 +01:00
suffix_formatter
visualizations
constants.test.ts [Lens] Fix yAxis scale/custom domain issues and help/error text (#180532) 2024-05-06 09:29:04 -07:00
constants.ts [Lens] Enables color mapping for new charts (#176821) 2024-02-14 16:20:25 +02:00
index.ts [Visualizations] Removes the export * from the plugins index files. (#154019) 2023-03-30 14:20:29 +03:00
layer_types.ts [Lens] Support metric trendlines (#141851) 2022-10-18 14:50:51 -05:00
types.ts Upgrade prettier dependencies (#188032) 2024-07-24 17:29:05 +01:00