[Chartjs]-Adding a Title to a Chart.js line graph

7👍

Instead of drawing on the canvas, I simply add a label around the element

<label for = "idOfCanvas">
Your Label<br />
    <canvas></canvas>
</label>

2👍

You’d need to add the title with specifics in your options section and ensure display is set to true. Something like so:

options: {
    title: {
        display: true,
        text: 'Name of Your Line Chart'
    }
}

Here’s a link to the Chartjs documentation

1👍

In the option add this parameter

    multiTooltipTemplate: "<%= datasetLabel %> - <%= value %>"

Leave a comment