{"action":"created","issue":{"url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/210","labels_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/210/comments","events_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/210/events","html_url":"https://github.com/jtblin/angular-chart.js/issues/210","id":106731927,"number":210,"title":"Legend template not working","user":{"login":"igorissen","id":6919604,"avatar_url":"https://avatars.githubusercontent.com/u/6919604?v=3","gravatar_id":"","url":"https://api.github.com/users/igorissen","html_url":"https://github.com/igorissen","followers_url":"https://api.github.com/users/igorissen/followers","following_url":"https://api.github.com/users/igorissen/following{/other_user}","gists_url":"https://api.github.com/users/igorissen/gists{/gist_id}","starred_url":"https://api.github.com/users/igorissen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igorissen/subscriptions","organizations_url":"https://api.github.com/users/igorissen/orgs","repos_url":"https://api.github.com/users/igorissen/repos","events_url":"https://api.github.com/users/igorissen/events{/privacy}","received_events_url":"https://api.github.com/users/igorissen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-16T09:11:34Z","updated_at":"2015-09-16T09:52:08Z","closed_at":"2015-09-16T09:52:08Z","body":"Hi,\r\n\r\nI try to set a legend template to my line chart without success.\r\nAny idea how to set a legend template ?\r\n\r\nThis is the option that I use for my line chart :\r\n\r\n```js\r\nvar options = {\r\n    bezierCurve: false,\r\n    datasetFill: false,\r\n    scaleGridLineColor: \"#3E434E\",\r\n    legendTemplate: \"<ul class=\\\"<%=name.toLowerCase()%>-legend\\\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\\\"background-color:<%=datasets[i].strokeColor%>\\\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>\"\r\n}\r\n```\r\n\r\nThanks.\r\n\r\n**EDIT**:\r\n\r\nI also add a listener for the `create` event on the scope to check if the legend template is correctly set.\r\n\r\n```js\r\n/* @ngInject */\r\nfunction Controller($rootScope, $scope, logger, request) {\r\n    var vm = this;\r\n    ...\r\n    ...\r\n    $scope.$on(\"create\", function (event, chart) {\r\n        console.log(chart);\r\n        console.log(chart.generateLegend());\r\n    });\r\n}\r\n```\r\n\r\nIn the output I can find the legendTemplate in chart options but when I generate the legend HTML I don't have the correct HTML (always your template).\r\n\r\nIs this a bug that the option property legendTemplate isn't working ?\r\n"},"comment":{"url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/comments/140691574","html_url":"https://github.com/jtblin/angular-chart.js/issues/210#issuecomment-140691574","issue_url":"https://api.github.com/repos/jtblin/angular-chart.js/issues/210","id":140691574,"user":{"login":"igorissen","id":6919604,"avatar_url":"https://avatars.githubusercontent.com/u/6919604?v=3","gravatar_id":"","url":"https://api.github.com/users/igorissen","html_url":"https://github.com/igorissen","followers_url":"https://api.github.com/users/igorissen/followers","following_url":"https://api.github.com/users/igorissen/following{/other_user}","gists_url":"https://api.github.com/users/igorissen/gists{/gist_id}","starred_url":"https://api.github.com/users/igorissen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igorissen/subscriptions","organizations_url":"https://api.github.com/users/igorissen/orgs","repos_url":"https://api.github.com/users/igorissen/repos","events_url":"https://api.github.com/users/igorissen/events{/privacy}","received_events_url":"https://api.github.com/users/igorissen/received_events","type":"User","site_admin":false},"created_at":"2015-09-16T09:52:08Z","updated_at":"2015-09-16T09:52:08Z","body":"Ok my bad.\r\n\r\nDidn't notice that you use the same template but you had style to it.\r\n\r\nSorry about that and thank you for your work!"}}