score:0
you need to use legendtemplate, make sure you replace the $scope.data in your app :p
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
score: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>",
};
Source: stackoverflow.com
Related Query
- Angular chart how to show the legend data value by default along with legend name
- How to show tooltip value of all data falling on the same axis in chart js?
- How to show symbols after the label and before the numeric value using chart.js Bar chart in Angular
- chart js tooltip how to control the data that show
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- How do I customize y-axis labels and randomly pick the value from the data range for x-axis in Chart js
- Angular 2: How to pass my API data to graph and Display the Graph with data
- How to reuse a Chartjs Chart component in with different Data and get past the **Canvas is already in use** error?
- How to show the chartjs bar chart data values labels as text?
- ChartJS Pie Chart How default just show 2 legend datas
- How to remove the Legend of chart from angular Chart.js
- how to write labels along with data on top and bottom of each stack in bar chart
- How write the labels of the data inside a Doughnut Chart made with Chart.js?
- How to start the chart from specific time and offest hour and then show the data on chart from target datetime in chartjs
- angular-chart.js doughnut chart : how to show data in the center of a chart
- Chart.js how to make chart only show the most recent data
- How to set the data of chart in angular which is taken from the backend nodejs api that is store in mongodb and showing on the html page
- How do I customize the chart.js tooltip? Two labels have the same data, which I want to show you with each data
- how to show data value on bar chart body rather than using tooltip?
- chart js how to fill legend box with colour
- Chart JS show multiple data points for the same label
- How to display data labels outside in pie chart with lines in ionic
- Remove the label and show only value in tooltips of a bar chart
- Chart Js Show the old data on mouse hover
- Chart js: how can I align the legend and the title
- PrimeNg bar chart how to show a label for the y-axis
- How to show only the data points that have a change in Chartjs?
- How can I display the xAxes and yAxes data in the tooltip, Chart JS?
- How can I trigger the hover mode from outside the chart with charts.js 2?
- How to update data Chart in async way in Angular Chart.js?
More Query from same tag
- How to change the Y-axis value in chartjs
- How to create multi scale chart?
- Chart.js: Make part of labels bold
- Are we able to position the y axis in the center of the x axis?
- Javascript generate random color with equivalent highlight
- How to include Chart.js in my AngularJS project?
- Realtime chart JS in Java obtaining the data from a sensor ;Chart.js: Failed to create chart: can't acquire context from the given item
- How to set additional options for Chart.js BarCharts using React-Chartkick
- Bubble getting cut off in Chart.js
- Chart.js and long labels
- ChartJS - Finding the minimum and maximum labels that are inside a pan (When zooming)
- Cannot use npm module react-chartjs with React
- How to expand the "Y" scale of the data in chart.js?
- How to make bars change color based on value in chartsjs
- Chart.js multiTooltip Labels in Pie
- Display Chart.js chart in Node.js
- Aurelia - Unhandled rejection - Chart.js and Moment.js
- How to remove legend at the bottom of chartjs doughnuts
- Changing grid color in radar chart
- Charts.js - Colors for stacked bar on multi-series line/bar chart are not working
- chart.js - user add the final point of the line
- How to create datasets dynamically for chart.js Line chart?
- Chart.js with JSON data error
- Hide label on slice of Doghnut/Pie Chart Angular ng2-charts
- Chart.js : How to fill the area under the line to a certain point?
- How to remove only one specific dataset label chartJS?
- Chart.js time series showing empty plot
- I am using chart.js I sent my time values throw my api as timestamp know i need to show them in the chart as date format
- Artefacts when showing compact vertical bar chart in chart.js
- get yLabel value onclick chart js