score:1
Accepted answer
you can use filter options for customizing your labels
example down below
legend: {
display: true,
labels: {
usepointstyle: true,
text: "hello world",
fontcolor: "black",
fontsize: 15,
filter: function(legenditem, data) {
let labels = data.labels, datasets = data.datasets[0].data;
for(let i=0;i<labels.length;i++){
if(labels[i].indexof(legenditem.text)!=-1){
let t = legenditem.text;
legenditem.text = t+' : '+datasets[i] + '%';
break;
}
}
return legenditem;
},
},
position: "bottom"
}
Source: stackoverflow.com
Related Query
- ChartJS - How to add Text between Pie Chart and Legend
- how to increase space between legend and chart in chartjs (ng2charts ) using angular
- chartjs datalabels change font and color of text displaying inside pie chart
- How to change the color of legend in chartjs and be able to add one more legend?
- Chart,js Pie Chart can the gap between a pie chart and the legend be adjusted
- ChartJS version 3 how to add percentage to pie chart tooltip
- how to add percentage value to legend field in pie chart using chart.js
- how to add legend in pie chart
- ChartJS Pie Chart How default just show 2 legend datas
- How can I reduce the spacing between my legend and chart proper in my Chart.JS bar chart, and increase it in the graph area?
- How to increase the size of the donut or pie chart and keep the legend next to it in chart JS?
- How to add custom text inside the bar and how to reduce the step size in y axis in chart js( Bar chart )
- How can I add functionality to Chartjs Doughnut chart custom legend
- Laravel - How to Display both count and percentage (%) in chartjs pie chart
- ChartJS distinguish clicks between chart area, dataset and legend
- How to add a coloured legend box to a pie chart with Chart.js v1?
- How to add vertical line in bar chart using chartJs and ng2-charts?
- How do I increase the space between the Legend and the Chart when using angular-chart.js?
- How to add space Between Columns in Bar chartjs and remove the space in the end
- How to add text inside the doughnut chart using Chart.js?
- Chart.js - Increase spacing between legend and chart
- How to add second Y-axis for Bar and Line chart in Chart.js?
- How to add text in centre of the doughnut chart using Chart.js?
- How to add label for ChartJs Legend
- Chart js: how can I align the legend and the title
- Increase padding between legend and chart with react-chartjs-2
- How can I add some text in the middle of a half doughnut chart in Chart.JS?
- How to add background color between two lines in yAxis Chartjs
- How to add ChartJS code in Html2Pdf to view image
- How to draw a needle on a custom donut chart and add datapoints to the needle?
More Query from same tag
- How can I put my label on the right hand side of my chart in Chartjs
- How can I control the placement of my Chart.JS pie chart's legend, as well as its appearance?
- Chart.js - Make x-axis grouped by day
- Chart.js : Multiple colors for tooltipFontColor
- Convert two lists into a dictionary of X and Y Format
- Drilldown on barchart using CHARTJS Devexpress
- The data that is called in chart does not match the database
- Angular 8 and ng2 charts - Updating labels and data
- ng2-charts - Tolltip color dont match line color
- Chart.js V2 ticklines no grid
- How to set axes' step size in Chart.js 2?
- Radarwidth beyond label chart.js
- Extending Existing Chart Types angular chart js using chart js 2.0
- How to convert a bar legend to line legend in chart.js 2.7.2?
- Issues with react-chartjs-2
- How to delete a chart (canvas) out of its scope?
- Different color for each column in angular-chartjs bar chart
- JQuery insertAfter() Method only works once when inserting a Chart.js chart
- Stacked bar chart with rounded corner of bar using Chart.js
- Chartjs: How to create padding between ticks and scale label
- Chart js - Polar Scatter Chart
- How to add comma in this chart js
- Chartjs - Line between two dots on the Y axis
- Graphs sharing datasets in chartjs
- How to make a chart with an associative array with chart.js?
- Thicker X-Axis with Charts.js
- How to stack time charts vertically
- angular-chart.js doughnut chart : how to show data in the center of a chart
- Remove background on Chartjs v2 fixed tooltips
- Chartjs: Why do I have 2 Y Axis labels?