Open bhavyarm opened 5 months ago
Pinging @elastic/kibana-visualizations (Team:Visualizations)
Pinging @elastic/kibana-esql (Team:ESQL)
This is not a bug although I do understand the confusion. If you see what is going on it adds the @timestamp in the horizontal axis but it the raw value (no date_truck or bucket used) so EC do not render the bars correectly
@nickofthyme maybe you can explain why this happens. I think a warning in ase of raw timestamps is a good idea. We are already exploring this idea here https://github.com/elastic/kibana/issues/184205
Not sure if we need 2 issues to track this but I will let this to the viz team to decide
@stratoula I believe this error on rendering is related to the fact that the @timestamp
column seems not typed as date in the lens configuration. Can you please check if is possible to pass that parameter when clear column type is available?
In this case, it seems that we are interpreting the timestamp as number (the axis shown is a numeric one).
The other problem, as linked by Stratoula relates to the fact that, to render bars we need to understand what is the bar width. We internally compute it as the minimum distance between consecutive time buckets (to avoid overlaps) but in this case it seems that the bar width is too small to be even visible.
Interesting. Have you checked that or you are assuming from seeing the chart?
@markov00 no, it remains a date field, something else is going wrong here. I guess it what I mention above but is better to check it too. But the field type is correct, I checked
oh strange, so there is something else wrong because the axis style is definitely wrong
It tries to render dates though
From my tests the bug affects only non-stacked versions of the bar chart. Debugging the state of the component in the video, it seems that this check is failing: https://github.com/elastic/kibana/blob/ab6ecdb3a5f6ec1df45668982987cdd236441563/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx#L672-L675
So the new time axis mode is not enabled, leaving to "simple" dates to render on the X-axis: https://github.com/elastic/kibana/blob/ab6ecdb3a5f6ec1df45668982987cdd236441563/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx#L677-L678
The root problem is this check: https://github.com/elastic/kibana/blob/ab6ecdb3a5f6ec1df45668982987cdd236441563/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx#L396-L401
When transitioning from table to Vertical Bar a breakdown dimension is automatically added to the Lens configuration, and that disables the new time axis. It's the equivalent for form-based configuration, the granularity of the date histogram here makes it just worse, where a bar is less than a pixel. Switching to stacked Vertical bar makes the bars appear again.
@dej611 well done 👏 So this happens in DSL charts too, correct?
Yes, I can replicate the same behaviour with DSL charts as well. It's just that a bucket in DSL cannot be 1ms, so it does not look that bad. Here's the smaller I could get for DSL:
I believe with a timestamp and a breakdown by a bar chart should always be shown as stacked bar, where instead a line/area chart can also be non-stacked by default.
We never suggest it, Bhavya selected it from the chart switcher here
I've created https://github.com/elastic/elastic-charts/issues/2461 to handle that on chart side by rendering at least 1px wide bars
Kibana version: 8.14.0 BC7
Browser version: chrome latest
Browser OS version: OS X
Original install method (e.g. download page, yum, from source, etc.): from staging
Describe the bug: If user switches from table to one of the bar charts on Create ES|QL visualization on a simple query like from _kibana_sample_datalogs | limit 1000, Kibana displays empty panel.
Steps to reproduce:
Screenshots (if relevant):
https://github.com/elastic/kibana/assets/7074629/6f68bf16-8711-4a43-8492-7e225ac0faa2