chartjs-plugin-labels
chartjs-plugin-labels copied to clipboard
Allow setting dynamic font size or array of font sizes
This allows you to scale the font size with the size of the chart, like so:
fontSize: ({ chart }) => {
const { bottom, left, right, top } = chart.chartArea;
const size = Math.round(Math.min(bottom - top, right - left) / 16);
return size;
}