Skip to content

[Lens] Prevent gaps in percentage charts#93812

Closed
dej611 wants to merge 2 commits intoelastic:masterfrom
dej611:fix/93648
Closed

[Lens] Prevent gaps in percentage charts#93812
dej611 wants to merge 2 commits intoelastic:masterfrom
dej611:fix/93648

Conversation

@dej611
Copy link
Copy Markdown
Contributor

@dej611 dej611 commented Mar 5, 2021

Summary

Fixes #93648

This PR addresses a bug, from the consumer side, of the elastic-charts library with missing buckets in date histograms.
Also, as a nice side effect, it fixes also the tooltip behaviour, showing now all series all the time in the chart.

Combined with #93717 (which contains a fix for percentage charts with overflow buckets) it completely fixes the problem. Already tested together.

Before:

Screenshot 2021-03-05 at 19 06 51

After:

Screenshot 2021-03-05 at 19 07 47

Tooltip issue before:
Screenshot 2021-03-05 at 19 07 06

Tooltip after:

Screenshot 2021-03-05 at 19 07 55

@dej611
Copy link
Copy Markdown
Contributor Author

dej611 commented Mar 8, 2021

@elasticmachine merge upstream

@dej611 dej611 marked this pull request as ready for review March 8, 2021 09:00
@dej611 dej611 requested a review from a team March 8, 2021 09:00
@dej611 dej611 added the Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// label Mar 8, 2021
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@kibanamachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
lens 920.9KB 922.0KB +1.2KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@flash1293
Copy link
Copy Markdown
Contributor

That's a pretty involved change (I thought it would just be about if (value === null) { value = 0; }.

@nickofthyme do you have a rough time frame for elastic/elastic-charts#1053 ? Will it land in 7.13? If that's the case and it would avoid the need for this PR I would be more comfortable with waiting until it can be fixed in a nice way.

If the upstream fix won't cover the full bug, then it makes sense to merge this.

@nickofthyme
Copy link
Copy Markdown
Contributor

@flash1293 I'll look at this today and get a better idea of the timeline. My hunch is that this should be easy to fix in charts and patch the 7.12 elastic-charts version.

@nickofthyme
Copy link
Copy Markdown
Contributor

nickofthyme commented Mar 8, 2021

Per discussion with @dej611 and @markov00...

The gaps are created when values are missing as indended. See https://codesandbox.io/s/voltron-lij5x?file=/src/App.tsx

Screen.Recording.2021-03-08.at.12.41.11.PM.mp4

Green series missing a value at 9:30

which filling missing values with 0would inaccurately indicate continuous data. One option is to set fit to zero for stacked percentage area chart in Lens.

Actions:

  • @markov00 to discuss with @monfera tomorrow about a better approach than using fit = 'zero'.
  • @dej611 is checking how adding the zero fit option by default would look on the Lens example data.

@nickofthyme
Copy link
Copy Markdown
Contributor

Closing in favor of #94086

@nickofthyme nickofthyme closed this Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Lens release_note:fix Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v7.13.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Lens] Percentage charts can have gaps in a series

5 participants