{"action":"created","issue":{"url":"https://api.github.com/repos/cmaurer/angularjs-nvd3-directives/issues/55","labels_url":"https://api.github.com/repos/cmaurer/angularjs-nvd3-directives/issues/55/labels{/name}","comments_url":"https://api.github.com/repos/cmaurer/angularjs-nvd3-directives/issues/55/comments","events_url":"https://api.github.com/repos/cmaurer/angularjs-nvd3-directives/issues/55/events","html_url":"https://github.com/cmaurer/angularjs-nvd3-directives/issues/55","id":23010049,"number":55,"title":"Ability to put label in the middle of the donut","user":{"login":"cmaurer","id":1733915,"avatar_url":"https://avatars.githubusercontent.com/u/1733915?v=3","gravatar_id":"","url":"https://api.github.com/users/cmaurer","html_url":"https://github.com/cmaurer","followers_url":"https://api.github.com/users/cmaurer/followers","following_url":"https://api.github.com/users/cmaurer/following{/other_user}","gists_url":"https://api.github.com/users/cmaurer/gists{/gist_id}","starred_url":"https://api.github.com/users/cmaurer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmaurer/subscriptions","organizations_url":"https://api.github.com/users/cmaurer/orgs","repos_url":"https://api.github.com/users/cmaurer/repos","events_url":"https://api.github.com/users/cmaurer/events{/privacy}","received_events_url":"https://api.github.com/users/cmaurer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cmaurer/angularjs-nvd3-directives/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/cmaurer/angularjs-nvd3-directives/labels/PieChart","name":"PieChart","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2013-11-20T18:13:24Z","updated_at":"2015-01-11T15:50:03Z","closed_at":null,"body":"I need to write a number in the center of the donut pie graph."},"comment":{"url":"https://api.github.com/repos/cmaurer/angularjs-nvd3-directives/issues/comments/69498864","html_url":"https://github.com/cmaurer/angularjs-nvd3-directives/issues/55#issuecomment-69498864","issue_url":"https://api.github.com/repos/cmaurer/angularjs-nvd3-directives/issues/55","id":69498864,"user":{"login":"hibrid","id":363897,"avatar_url":"https://avatars.githubusercontent.com/u/363897?v=3","gravatar_id":"","url":"https://api.github.com/users/hibrid","html_url":"https://github.com/hibrid","followers_url":"https://api.github.com/users/hibrid/followers","following_url":"https://api.github.com/users/hibrid/following{/other_user}","gists_url":"https://api.github.com/users/hibrid/gists{/gist_id}","starred_url":"https://api.github.com/users/hibrid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hibrid/subscriptions","organizations_url":"https://api.github.com/users/hibrid/orgs","repos_url":"https://api.github.com/users/hibrid/repos","events_url":"https://api.github.com/users/hibrid/events{/privacy}","received_events_url":"https://api.github.com/users/hibrid/received_events","type":"User","site_admin":false},"created_at":"2015-01-11T15:50:03Z","updated_at":"2015-01-11T15:50:03Z","body":"@matthiaslao That actually works well. I ran into a problem with updating the text and in that case, I modified your solution to do this where needed (so not necessarily inside of the callback):\r\n\r\n\r\n\t\t\t\t\t\tvar svg = d3.select(\"svg\");\r\n\t\t\t\t\t\tvar donut = svg.selectAll(\"g.nv-pie\").filter(\r\n\t\t\t\t\t\t\tfunction (d, i) {\r\n\t\t\t\t\t\t\t\treturn i == 1;\r\n\t\t\t\t\t\t\t});\r\n\r\n\r\n\t\t\t\t\t\t// Inserting text\r\n\t\t\t\t\t\tdonut.select(\"text\").text(\"new text\");"}}