Reputation: 3329
I'm using ChartJS 3.7 and even when I pass options.plugins.legend.display
a true
, the legend isn't displayed. How do I get the legend to show?
Upvotes: 1
Views: 675
Reputation: 3329
Looks like newer versions of ChartJS require you to register the individual elements you're going to use. You need to register the legend specifically.
import { Chart, Legend } from 'chart.js';
// ...
Chart.register(Legend);
Upvotes: 1