Is it possible to get line breaks in chartjs tooltips?
tooltipTemplate: \"<%if (label){%><%=label%>: <%}%><%= value %>\"
You can use tooltips footer callback,it will also not render coloured square for each list.
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
let label = data.datasets[tooltipItem.datasetIndex].label;
let value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
return label + ': ' + value;
},
footer: function(tooltipItems, data) {
return ['new line', 'another line'];
}
}
}