{"action":"created","issue":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/934","labels_url":"https://api.github.com/repos/bokeh/bokeh/issues/934/labels{/name}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/934/comments","events_url":"https://api.github.com/repos/bokeh/bokeh/issues/934/events","html_url":"https://github.com/bokeh/bokeh/issues/934","id":39186580,"number":934,"title":" Aggregate and Chart in One Shot ala Excel Pivot Charts","user":{"login":"aschneiderman","id":6363322,"avatar_url":"https://avatars.githubusercontent.com/u/6363322?v=3","gravatar_id":"","url":"https://api.github.com/users/aschneiderman","html_url":"https://github.com/aschneiderman","followers_url":"https://api.github.com/users/aschneiderman/followers","following_url":"https://api.github.com/users/aschneiderman/following{/other_user}","gists_url":"https://api.github.com/users/aschneiderman/gists{/gist_id}","starred_url":"https://api.github.com/users/aschneiderman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aschneiderman/subscriptions","organizations_url":"https://api.github.com/users/aschneiderman/orgs","repos_url":"https://api.github.com/users/aschneiderman/repos","events_url":"https://api.github.com/users/aschneiderman/events{/privacy}","received_events_url":"https://api.github.com/users/aschneiderman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/bokeh/bokeh/labels/tag:%20charts","name":"tag: charts","color":"D0CBB8"},{"url":"https://api.github.com/repos/bokeh/bokeh/labels/type:%20feature","name":"type: feature","color":"53777A"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/bokeh/bokeh/milestones/12","html_url":"https://github.com/bokeh/bokeh/milestones/long-term","labels_url":"https://api.github.com/repos/bokeh/bokeh/milestones/12/labels","id":811344,"number":12,"title":"long-term","description":"Collects issues that need to be resolved on a medium-to-long time frame.\r\nSuch issues may require extensive work, or possibly architectural changes. This milestone is always open and is populated from new (unmilestoned) issues.\r\n\r\nRef: https://github.com/ContinuumIO/bokeh/wiki/BEP-1:-Issues-and-PRs-management#issue-times\r\n\r\n","creator":{"login":"damianavila","id":1640669,"avatar_url":"https://avatars.githubusercontent.com/u/1640669?v=3","gravatar_id":"","url":"https://api.github.com/users/damianavila","html_url":"https://github.com/damianavila","followers_url":"https://api.github.com/users/damianavila/followers","following_url":"https://api.github.com/users/damianavila/following{/other_user}","gists_url":"https://api.github.com/users/damianavila/gists{/gist_id}","starred_url":"https://api.github.com/users/damianavila/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damianavila/subscriptions","organizations_url":"https://api.github.com/users/damianavila/orgs","repos_url":"https://api.github.com/users/damianavila/repos","events_url":"https://api.github.com/users/damianavila/events{/privacy}","received_events_url":"https://api.github.com/users/damianavila/received_events","type":"User","site_admin":false},"open_issues":89,"closed_issues":21,"state":"open","created_at":"2014-10-02T12:31:00Z","updated_at":"2015-12-03T18:56:05Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2014-07-31T11:45:29Z","updated_at":"2015-12-10T16:54:50Z","closed_at":null,"body":"When users want to create a bar graph, scatter chart, etc.,  they frequently need to aggregate the data. Right now it's a two-step process: aggregate the data via aggregate or pivot_table, then create a chart. It would be great if you could do it in one shot ala Excel Pivot Charts. For example:\r\n\r\nScatter(products, x='Year', y='Product Type', function='count')\r\nor\r\nScatter(products, x='Year', y='Product Type', function='sum', aggregate_field='Revenue')\r\n\r\nAlthough you could trick out this feature to handle much more complex cases, I wouldn't bother – the vast majority of the time users only need to do a simple aggregation.\r\n\r\nA suggestion from one of my colleagues on choosing a name for the parameter specifying which function to use to aggregate the data:\r\n> I would personally suggest something like “Function”, “Perform” or “Calculate”. When you think about how this would be spoken, you’d say \r\n>- I want to run the sum function on flowers\r\n>- I want to calculate the sum of flowers\r\n>- I want to perform the sum operation on flowers"},"comment":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/comments/163686019","html_url":"https://github.com/bokeh/bokeh/issues/934#issuecomment-163686019","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/934","id":163686019,"user":{"login":"rothnic","id":452052,"avatar_url":"https://avatars.githubusercontent.com/u/452052?v=3","gravatar_id":"","url":"https://api.github.com/users/rothnic","html_url":"https://github.com/rothnic","followers_url":"https://api.github.com/users/rothnic/followers","following_url":"https://api.github.com/users/rothnic/following{/other_user}","gists_url":"https://api.github.com/users/rothnic/gists{/gist_id}","starred_url":"https://api.github.com/users/rothnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rothnic/subscriptions","organizations_url":"https://api.github.com/users/rothnic/orgs","repos_url":"https://api.github.com/users/rothnic/repos","events_url":"https://api.github.com/users/rothnic/events{/privacy}","received_events_url":"https://api.github.com/users/rothnic/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T16:54:50Z","updated_at":"2015-12-10T16:54:50Z","body":"I think there is some cleanup needed, but the example should now be possible with charts. An aggregation type is exposed via things like bar chart, but also you can use the binning specification to summarize the data going into any chart, though we need to add examples/testing across them all.\r\n\r\nAny dimension to a chart should accept the result of the [bins](https://github.com/bokeh/bokeh/blob/master/bokeh/charts/stats.py#L379) function. See the [heatmap chart examples](https://github.com/bokeh/bokeh/blob/master/examples/charts/file/heatmap.py) where this is primarily being used."}}