{"action":"created","issue":{"url":"https://api.github.com/repos/novus/nvd3/issues/1878","repository_url":"https://api.github.com/repos/novus/nvd3","labels_url":"https://api.github.com/repos/novus/nvd3/issues/1878/labels{/name}","comments_url":"https://api.github.com/repos/novus/nvd3/issues/1878/comments","events_url":"https://api.github.com/repos/novus/nvd3/issues/1878/events","html_url":"https://github.com/novus/nvd3/issues/1878","id":192740888,"number":1878,"title":"LineChart: Wrong color of focus(nvd3 1.8.4)","user":{"login":"fan-self","id":20783245,"avatar_url":"https://avatars.githubusercontent.com/u/20783245?v=3","gravatar_id":"","url":"https://api.github.com/users/fan-self","html_url":"https://github.com/fan-self","followers_url":"https://api.github.com/users/fan-self/followers","following_url":"https://api.github.com/users/fan-self/following{/other_user}","gists_url":"https://api.github.com/users/fan-self/gists{/gist_id}","starred_url":"https://api.github.com/users/fan-self/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fan-self/subscriptions","organizations_url":"https://api.github.com/users/fan-self/orgs","repos_url":"https://api.github.com/users/fan-self/repos","events_url":"https://api.github.com/users/fan-self/events{/privacy}","received_events_url":"https://api.github.com/users/fan-self/received_events","type":"User","site_admin":false},"labels":[{"id":19411978,"url":"https://api.github.com/repos/novus/nvd3/labels/Bug","name":"Bug","color":"fc2929","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-01T02:45:55Z","updated_at":"2017-02-01T16:47:29Z","closed_at":null,"body":"The screenshot below are [examples of lineChart](https://github.com/novus/nvd3/archive/v1.8.4.zip) with some modifications:\r\n\r\nDisable the color of each series:\r\n return [{\r\n                area: true,\r\n                values: sin,\r\n                key: \"Sine Wave\",\r\n                //color: \"#ff7f0e\",\r\n                strokeWidth: 4,\r\n                classed: 'dashed'\r\n            }, {\r\n                values: cos,\r\n                key: \"Cosine Wave\"//,\r\n                //color: \"#2ca02c\",\r\n            }, {\r\n                values: rand,\r\n                key: \"Random Points\"//,\r\n                //color: \"#2222ff\",\r\n            }, {\r\n                values: rand2,\r\n                key: \"Random Cosine\",\r\n                //color: \"#667711\",\r\n                strokeWidth: 3.5\r\n            }, {\r\n                area: true,\r\n                values: sin2,\r\n                key: \"Fill opacity\",\r\n                //color: \"#EF9CFB\",\r\n                fillOpacity: .1\r\n            }];\r\n\r\n1. The initialization is correct.\r\n![image](https://cloud.githubusercontent.com/assets/20783245/20779401/4cd397ee-b7af-11e6-9b14-9149a1dac2f6.png)\r\n\r\n2. Disable some series, color of \"Random Points\" in focus is incorrect.\r\n![image](https://cloud.githubusercontent.com/assets/20783245/20779418/678e1bb8-b7af-11e6-9226-1a6d8d214b45.png)\r\n\r\n- The content of focus(nv.models.focus) is like this:\r\ncontent\r\n.width(availableWidth)\r\n     .height(availableHeight)\r\n     .color(data.map(function(d,i) {\r\n               return d.color || color(d, i);\r\n \t     \t}).filter(function(d,i) { return !data[i].disabled; }));\r\n\r\n\r\n\r\n\r\n- But the lineChart passed ‘!disabled dataset’  to focus, like this:\r\ng.select('.nv-focusWrap')\r\n.attr('transform', 'translate(0,' + (availableHeight + margin.bottom + focus.margin().top) + ')')\r\n_**.datum(data.filter(function(d) { return !d.disabled; }))**_\r\n.call(focus);\r\n\r\nSample:\r\nhttps://jsfiddle.net/kptatqzy/\r\n\r\n\r\nSuppose the italic statement should be removed.\r\n"},"comment":{"url":"https://api.github.com/repos/novus/nvd3/issues/comments/276710962","html_url":"https://github.com/novus/nvd3/issues/1878#issuecomment-276710962","issue_url":"https://api.github.com/repos/novus/nvd3/issues/1878","id":276710962,"user":{"login":"liquidpele","id":1065913,"avatar_url":"https://avatars.githubusercontent.com/u/1065913?v=3","gravatar_id":"","url":"https://api.github.com/users/liquidpele","html_url":"https://github.com/liquidpele","followers_url":"https://api.github.com/users/liquidpele/followers","following_url":"https://api.github.com/users/liquidpele/following{/other_user}","gists_url":"https://api.github.com/users/liquidpele/gists{/gist_id}","starred_url":"https://api.github.com/users/liquidpele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liquidpele/subscriptions","organizations_url":"https://api.github.com/users/liquidpele/orgs","repos_url":"https://api.github.com/users/liquidpele/repos","events_url":"https://api.github.com/users/liquidpele/events{/privacy}","received_events_url":"https://api.github.com/users/liquidpele/received_events","type":"User","site_admin":false},"created_at":"2017-02-01T16:47:29Z","updated_at":"2017-02-01T16:47:29Z","body":"Yup, seems to be a bug.  Please send a pull request with what you suggest as a fix :)"}}
{"actor":{"display_login":"liquidpele"}}