Date Range Agg - key needs to be a string#58938
Date Range Agg - key needs to be a string#58938majagrubic wants to merge 3 commits intoelastic:masterfrom
Conversation
|
You are completely right @majagrubic , that's the PR which caused the bug. I would recommend not to revert the change though because we need access to the raw object of the range to be able to correctly build the filter when clicking a bar / pie slice in a chart in If you want to continue to look into this (happy to take it over if you want), I would recommend trying to stringify the value somehow to make it compatible with d3, e.g. before passing it into https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis_scale.js#L246 |
💔 Build FailedHistory
To update your PR or re-run it, just comment with: |
Summary
Attempt at fixing: #57122.
The problem here is that d3 cannot take domain in the form
{from, to}:https://github.com/elastic/kibana/blob/master/src/legacy/core_plugins/vis_type_vislib/public/vislib/lib/axis/axis_scale.js#L246
It expect a value or an array. (Credits to Marco for figuring this out). This breaks the scale calculation and was probably introduced in this PR:
#48090
I think the reasonable solution would be to return to the previous state, ie. returning string key instead of an object. I'm not sure what are the implications of doing this and if something else would break. I tested this on the vertical bar with Date Range on X-Axis.
Before:

After:

Let me know what you think and if it's ok to continue down this path.
Checklist
Delete any items that are not applicable to this PR.
For maintainers