{"action":"closed","issue":{"url":"https://api.github.com/repos/elasticsearch/kibana/issues/2972","labels_url":"https://api.github.com/repos/elasticsearch/kibana/issues/2972/labels{/name}","comments_url":"https://api.github.com/repos/elasticsearch/kibana/issues/2972/comments","events_url":"https://api.github.com/repos/elasticsearch/kibana/issues/2972/events","html_url":"https://github.com/elasticsearch/kibana/issues/2972","id":57255106,"number":2972,"title":"Pie chart calculates percentages incorrectly with multiple top-N terms aggregations","user":{"login":"lukasolson","id":1178348,"avatar_url":"https://avatars.githubusercontent.com/u/1178348?v=3","gravatar_id":"","url":"https://api.github.com/users/lukasolson","html_url":"https://github.com/lukasolson","followers_url":"https://api.github.com/users/lukasolson/followers","following_url":"https://api.github.com/users/lukasolson/following{/other_user}","gists_url":"https://api.github.com/users/lukasolson/gists{/gist_id}","starred_url":"https://api.github.com/users/lukasolson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukasolson/subscriptions","organizations_url":"https://api.github.com/users/lukasolson/orgs","repos_url":"https://api.github.com/users/lukasolson/repos","events_url":"https://api.github.com/users/lukasolson/events{/privacy}","received_events_url":"https://api.github.com/users/lukasolson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elasticsearch/kibana/labels/blocker","name":"blocker","color":"ff0000"},{"url":"https://api.github.com/repos/elasticsearch/kibana/labels/bug","name":"bug","color":"ff0000"},{"url":"https://api.github.com/repos/elasticsearch/kibana/labels/PR%20pending","name":"PR pending","color":"EB9D20"}],"state":"closed","locked":false,"assignee":{"login":"spalger","id":1329312,"avatar_url":"https://avatars.githubusercontent.com/u/1329312?v=3","gravatar_id":"","url":"https://api.github.com/users/spalger","html_url":"https://github.com/spalger","followers_url":"https://api.github.com/users/spalger/followers","following_url":"https://api.github.com/users/spalger/following{/other_user}","gists_url":"https://api.github.com/users/spalger/gists{/gist_id}","starred_url":"https://api.github.com/users/spalger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spalger/subscriptions","organizations_url":"https://api.github.com/users/spalger/orgs","repos_url":"https://api.github.com/users/spalger/repos","events_url":"https://api.github.com/users/spalger/events{/privacy}","received_events_url":"https://api.github.com/users/spalger/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/elasticsearch/kibana/milestones/3","labels_url":"https://api.github.com/repos/elasticsearch/kibana/milestones/3/labels","id":815688,"number":3,"title":"4.0.0-RC1","description":"","creator":{"login":"rashidkpc","id":1250387,"avatar_url":"https://avatars.githubusercontent.com/u/1250387?v=3","gravatar_id":"","url":"https://api.github.com/users/rashidkpc","html_url":"https://github.com/rashidkpc","followers_url":"https://api.github.com/users/rashidkpc/followers","following_url":"https://api.github.com/users/rashidkpc/following{/other_user}","gists_url":"https://api.github.com/users/rashidkpc/gists{/gist_id}","starred_url":"https://api.github.com/users/rashidkpc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rashidkpc/subscriptions","organizations_url":"https://api.github.com/users/rashidkpc/orgs","repos_url":"https://api.github.com/users/rashidkpc/repos","events_url":"https://api.github.com/users/rashidkpc/events{/privacy}","received_events_url":"https://api.github.com/users/rashidkpc/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":224,"state":"open","created_at":"2014-10-06T19:58:40Z","updated_at":"2015-02-11T18:27:36Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-02-10T23:34:34Z","updated_at":"2015-02-11T18:27:36Z","closed_at":"2015-02-11T18:27:36Z","body":"1. Create a pie chart\r\n1. Split area on top 5 terms\r\n1. Split area again on some other top 5 terms\r\n1. Hover over the area\r\n\r\nThe percentages in the tooltip are calculated incorrectly.\r\n\r\nWhen you have a top-N terms aggregation, you may end up excluding some buckets. As you split each bucket by another top-N terms aggregation, you may lose even more buckets.\r\n\r\nIt looks as though the percentage of a slice is calculated based on the total number of buckets in the outermost ring, rather than the total number of buckets in its own ring.\r\n\r\n![screen shot 2015-02-10 at 4 33 33 pm](https://cloud.githubusercontent.com/assets/1178348/6138886/aa0da4c4-b142-11e4-8c80-5da6f6701815.png)"}}