[Chartjs]-Chart js v2 tooltip callback line breaks

8👍

The way to do it, is just adding a callback function for the tooltip property that returns an array of strings, each one of the strings will be placed in a new line.

tooltips: {
            callbacks: {
                label: function (tooltipItem, data) {
                    return ['first thing', 'another thing', 'and another one'];

                }
            }
            }

See this jsfiddle…

https://jsfiddle.net/alelase/6f8wrz03/3/

-2👍

Try use:

return tooltip + "<br />" + otherTooltip;

Leave a comment