Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird behavior for uneven distributed pie charts #19490

Closed
timroes opened this issue May 29, 2018 · 3 comments
Closed

Weird behavior for uneven distributed pie charts #19490

timroes opened this issue May 29, 2018 · 3 comments
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:ElasticCharts Issues related to the elastic-charts library Feature:Pie Chart Pie chart visualization feature still valid? Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@timroes
Copy link
Contributor

timroes commented May 29, 2018

If you have a pie chart, that has a very uneven distribution, i.e. very large and very slow slices and spare data on an outer level (at least I think that will be the cause), the chart drawing is behaving unpredictable.

Use the following sample data: data.zip

Installation instructions
unzip data.zip

curl -XPUT 'http://localhost:9200/hotel'

curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/hotel/type1/_bulk?pretty' --data-binary @1request.json
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/hotel/type1/_bulk?pretty' --data-binary @2request.json
curl -H 'Content-Type: application/x-ndjson' -XPOST 'localhost:9200/hotel/type1/_bulk?pretty' --data-binary @3request.json

If you now create a chart, with the following configuration:

  • Bucket 1: Terms group.keyword (desc, size 5)
  • Bucket 2: Filters:
    • city:tokyo
    • city:Osaka
    • city:nara
  • Metrics: Count

After hitting apply I sometimes end up with the following chart:

screenshot-20180529-094836

That chart looks not like what I would expect looking at the data:

screenshot-20180529-094918

Actually G1 is the lowest value in the inner circle, but it gets a slice that takes around 99% of the inner circle. It seems the chart does strip away those other slices because they don't have a value on the outer circle. Also if you hover over the inner circle, you see that G1 actually only has a percentage of 0.03% on that chart, but still it's slice is the only visible.

localhost_5601_zwc_app_kibana 1

Sometimes a resizing of the chart (e.g. in the below animation, by opening the dev tools and closing them again) helps to get the "correct" result. This is the way we would expect the inner level of the pie chart to look like. The outer level actually vanished because all it's slices having a subpixel size, which is issue #16931:

peek 2018-05-29 10-00

@timroes timroes added bug Fixes for quality problems that affect the customer experience Feature:Visualizations Generic visualization features (in case no more specific feature label is available) Feature:ElasticCharts Issues related to the elastic-charts library labels May 29, 2018
@timroes timroes added the Feature:Pie Chart Pie chart visualization feature label Jul 18, 2018
@timroes timroes added Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed Feature:Visualizations Generic visualization features (in case no more specific feature label is available) labels Sep 16, 2018
@flash1293 flash1293 self-assigned this Feb 7, 2019
@flash1293
Copy link
Contributor

@timroes Can't reproduce this for 6.6, 6.7 and master (Chrome Mac). Should this be part of the current stabilizing phase?

@timroes
Copy link
Contributor Author

timroes commented May 22, 2019

Did you try to reproduce it with the above sample data? If so we can close that for now, since it was reliable reproducible using that data.

@markov00
Copy link
Member

I've tested locally with the dataset. This is what I see:

Screenshot 2019-07-23 at 16 00 49

I've applied a slight black stroke to each slice to see the 2nd level that is actually all empty except for the G1 group that is 0.3% and has few documents with it.
Seems to the the right representation, what do you think @timroes ?

I've also tested the resizing of the page (with the chrometool open/close and resizing the windows) but it render always the same chart.

I'm closing this because seems to be fixed and/or not reproducible anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:ElasticCharts Issues related to the elastic-charts library Feature:Pie Chart Pie chart visualization feature still valid? Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

3 participants