1๐
Iโm using angular-chart 1.0.2. In my version Iโm using it like this;
$scope.options = {
legend: {display: true},
legendTemplate:
"<ul class=\"<%=name.toLowerCase()%>-legend\">" +
"<% for (var i=0; i<segments.length; i++){%>" +
"<li>" +
"<span style=\"background-color:<%=segments[i].fillColor%>\"></span>" +
"<%=segments[i].label%> (<%=segments[i].value%>)" +
"</li>" +
"<%}%>" +
"</ul>",
};
0๐
you need to use legendTemplate, make sure you replace the $scope.data in your app ๐
var options = {
legendTemplate: "<ul><% for (var i=0; i<data.length; i++){%><li><span style=\"background-color:<%=data[i].color%>\"></span><%=data[i].label%> - <%=data[i].value%></li><%}%></ul>"
}
see this jsfiddle
Source:stackexchange.com