FEATURE requests
Add title for legend
Legend doesn't sopport title
1.
2.
3.
4.
user expectation
@dhuallanca what kind of title do you envision for the legend?
@etimberg, I am using doughnut chart, I would like to have a title(Label) on the top of legends.
Second this. If I have a data series with days of the week, it'd be nice to have 'Week' as the legend title. This is even more important when a chart's independent variable and series are both True/False.
What's the difference with the chart title? Can you provide a mockup of what you are trying to build?
What's the difference with the chart title? Can you provide a mockup of what you are trying to build?

@dhuallanca ,
Hey i want to work on this ,can you explain a bit more about this
@jatiny17 , I want to add a Legend title on the top of legends items.

same problem, any help with it?
I find the way to hack this behavior, however it's not supported by default.
legend.labels.generateLabels = chart => {
var data = chart.data;
let labels = Chart.defaults.global.legend.labels.generateLabels(chart);
let title = {
text: 'Legend Title',
strokeStyle: 'transparent',
fillStyle: 'transparent',
lineWidth: 0
};
return [title, ...labels];
};


Most helpful comment