{"action":"created","issue":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/3333","labels_url":"https://api.github.com/repos/bokeh/bokeh/issues/3333/labels{/name}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/3333/comments","events_url":"https://api.github.com/repos/bokeh/bokeh/issues/3333/events","html_url":"https://github.com/bokeh/bokeh/issues/3333","id":121965885,"number":3333,"title":"Legend Update ","user":{"login":"brianpanneton","id":8185174,"avatar_url":"https://avatars.githubusercontent.com/u/8185174?v=3","gravatar_id":"","url":"https://api.github.com/users/brianpanneton","html_url":"https://github.com/brianpanneton","followers_url":"https://api.github.com/users/brianpanneton/followers","following_url":"https://api.github.com/users/brianpanneton/following{/other_user}","gists_url":"https://api.github.com/users/brianpanneton/gists{/gist_id}","starred_url":"https://api.github.com/users/brianpanneton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianpanneton/subscriptions","organizations_url":"https://api.github.com/users/brianpanneton/orgs","repos_url":"https://api.github.com/users/brianpanneton/repos","events_url":"https://api.github.com/users/brianpanneton/events{/privacy}","received_events_url":"https://api.github.com/users/brianpanneton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-14T02:59:20Z","updated_at":"2015-12-15T02:56:50Z","closed_at":null,"body":"I'm not sure where to ask this question and/or if it is a bug. \r\n\r\nI am attempting to hack together a streaming pie chart using wedges in 0.10.0. I have the pie chart working where wedges get added/updated.\r\n\r\nMy figure looks like this:\r\n``` python\r\n        plot = figure(toolbar_location=None,\r\n                      plot_width=800,\r\n                      plot_height=400,\r\n                      title=question,\r\n                      x_range=(-1.5, 3),\r\n                      y_range=(-2, 2),\r\n                      min_border=10,\r\n                      min_border_left=50,\r\n                      title_text_font_size='12pt')\r\n        plot.xaxis.visible = None\r\n        plot.xgrid.grid_line_color = None\r\n        plot.yaxis.visible = None\r\n        plot.ygrid.grid_line_color = None\r\n```\r\n\r\nand my update basically does this every few seconds:\r\n\r\n``` python\r\n            for i, (key, val) in enumerate(results[question].iteritems()):\r\n                wedge = {}\r\n                wedge['start'] = 2*pi*wedge_sum\r\n                wedge_sum = (val/float(total)) + wedge_sum\r\n                wedge['end'] = 2*pi*wedge_sum\r\n                wedge['name'] = '{:.40} ({:.2f} %)'.format(key, val/float(total))\r\n                wedge['color'] = colors[i%len(colors)]\r\n                wedges.append(wedge)\r\n\r\n            data[question[0]]._renderers = []\r\n            for i, wedge in enumerate(wedges):\r\n                data[question[0]].wedge(x=0, y=0, radius=1,\r\n                                           legend=wedge['name'],\r\n                                           start_angle=wedge['start'],\r\n                                           end_angle=wedge['end'],\r\n                                           color=wedge['color'],\r\n                                           line_color='black',\r\n                                           radius_units='data')\r\n            sessions[question[0]].store_objects(data[question[0]])\r\n```\r\n\r\nMy thought process was to clear all the wedges within the figure and redraw the updates. This part seems to work as I expected. However, once this occurs, the title and legend get redrawn incorrectly. The title disappears and the legend only has one item in it.\r\n\r\nIf I remove this line:\r\n``` python\r\n            data[question[0]]._renderers = []\r\n```\r\nThe title does not disappear and the legend gets updated when new wedges are added. However the legend box size doesn't get updated, so it writes the new wedge label outside of the box.\r\n\r\nI'm hoping there is a better way to achieve this. I can't seem to figure out how to access the legend to update it."},"comment":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/comments/164628895","html_url":"https://github.com/bokeh/bokeh/issues/3333#issuecomment-164628895","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/3333","id":164628895,"user":{"login":"brianpanneton","id":8185174,"avatar_url":"https://avatars.githubusercontent.com/u/8185174?v=3","gravatar_id":"","url":"https://api.github.com/users/brianpanneton","html_url":"https://github.com/brianpanneton","followers_url":"https://api.github.com/users/brianpanneton/followers","following_url":"https://api.github.com/users/brianpanneton/following{/other_user}","gists_url":"https://api.github.com/users/brianpanneton/gists{/gist_id}","starred_url":"https://api.github.com/users/brianpanneton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianpanneton/subscriptions","organizations_url":"https://api.github.com/users/brianpanneton/orgs","repos_url":"https://api.github.com/users/brianpanneton/repos","events_url":"https://api.github.com/users/brianpanneton/events{/privacy}","received_events_url":"https://api.github.com/users/brianpanneton/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T02:56:50Z","updated_at":"2015-12-15T02:56:50Z","body":"Is there a mailing list or better place to ask this question?"}}