{"action":"closed","issue":{"url":"https://api.github.com/repos/novus/nvd3/issues/652","labels_url":"https://api.github.com/repos/novus/nvd3/issues/652/labels{/name}","comments_url":"https://api.github.com/repos/novus/nvd3/issues/652/comments","events_url":"https://api.github.com/repos/novus/nvd3/issues/652/events","html_url":"https://github.com/novus/nvd3/issues/652","id":41710826,"number":652,"title":"Applying color for Pie chart which is coming from data","user":{"login":"sr77in","id":2126258,"avatar_url":"https://avatars.githubusercontent.com/u/2126258?v=3","gravatar_id":"","url":"https://api.github.com/users/sr77in","html_url":"https://github.com/sr77in","followers_url":"https://api.github.com/users/sr77in/followers","following_url":"https://api.github.com/users/sr77in/following{/other_user}","gists_url":"https://api.github.com/users/sr77in/gists{/gist_id}","starred_url":"https://api.github.com/users/sr77in/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sr77in/subscriptions","organizations_url":"https://api.github.com/users/sr77in/orgs","repos_url":"https://api.github.com/users/sr77in/repos","events_url":"https://api.github.com/users/sr77in/events{/privacy}","received_events_url":"https://api.github.com/users/sr77in/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-09-02T13:48:47Z","updated_at":"2015-02-10T04:37:10Z","closed_at":"2015-02-10T04:37:10Z","body":"Hi,\r\nI tried the 'LiveCode' http://nvd3.org/livecode/index.html#codemirrorNav  I tried with Pie Chart.\r\n\r\nModified code like this : JavaScript\r\n\r\n\r\nnv.addGraph(function() {\r\n  \r\n  var chart = nv.models.pieChart()\r\n      \r\n      .x(function(d) { return d.label })\r\n      .y(function(d) { return d.value })\r\n      .showLabels(true) ;\r\n  \r\n d3.scale.myColors = function() {\r\n  return d3.scale.ordinal().range(function(d) {return d.color});\r\n };\r\n      \r\n  chart.color(d3.scale.myColors().range());\r\n\r\n    d3.select(\"#chart svg\")\r\n        .datum(data)\r\n      .transition().duration(1200)      \r\n        .call(chart);\r\n\r\n  return chart;\r\n});\r\n\r\nand JSON like follows\r\n\r\n------------------------\r\n\r\n[\r\n      {\r\n        \"label\": \"One\",\r\n        \"value\" : 29.765957771107,\r\n        \"color\":\"#28aabb\"\r\n      } ,\r\n      {\r\n        \"label\": \"Two\",\r\n        \"value\" : 9,\r\n        \"color\": \"#bb5599\" \r\n      } ,\r\n      {\r\n        \"label\": \"Three\",\r\n        \"value\" : 32.807804682612,\r\n        \"color\":\"#88aabb\"\r\n      } ,\r\n      {\r\n        \"label\": \"Four\",\r\n        \"value\" : 196.45946739256,\r\n        \"color\":\"#700abb\"\r\n      } ,\r\n      {\r\n        \"label\": \"Five\",\r\n        \"value\" : 0.19434030906893,\r\n         \"color\":\"#2855bb\"\r\n      } ,\r\n      {\r\n        \"label\": \"Six\",\r\n        \"value\" : 98.079782601442,\r\n        \"color\":\"#a8aa88\"\r\n      } ,\r\n      {\r\n        \"label\": \"Seven\",\r\n        \"value\" : 13.925743130903,\r\n        \"color\":\"#f8aa55\"\r\n      } ,\r\n      {\r\n        \"label\": \"Eight\",\r\n        \"value\" : 5.1387322875705,\r\n        \"color\":\"#a8aa33\"\r\n      }\r\n]\r\n\r\n-----------------------------\r\n\r\nIt's showing colors in legends but not affecting the graph. What I have to do for fixing the issue?\r\nThanks\r\nShine"}}