Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Legend Label Font Size in Line Charts

Open sskinne opened this issue 10 years ago • 4 comments

Hi,

How can i change the Legend Label Font Size in Line Chart options ?

I can make the legend display or not display via the below option change:

legend:{display: true},

But as soon as I try to change the legend label Font Size it doesn't work, i have tried the following but doesn't work:

legend:{display: true, fontsize:40}, legend:{display: true, labels: {fontsize:40}}, legend:{display: true, _labels_fontSize:40}, legend:{display: true, labels[fontSize:40]}, labels:{fontSize: 40}, legend:{display: true, labels: [fontSize:40]},

Im using Chart.js 2.0.0-beta2

sskinne avatar Jan 27 '16 11:01 sskinne

Im using Chart.js 2.0.0-beta2

sskinne avatar Jan 27 '16 11:01 sskinne

I tried options:{legend:{display: true,labels:{fontSize:30}}} and it works quite well on a line chart under V2.0-dev

Are you sure you are well in the options ?

ps : maybe care about the case (the S of fontSize should be capsletter) I don't know if it matters

Dergonic avatar Jan 27 '16 13:01 Dergonic

@Dergonic ia correct. Font options are under legend.labels see documentation at http://nnnick.github.io/Chart.js/docs-v2/

etimberg avatar Jan 27 '16 13:01 etimberg

Many Thanks @Dergonic - That worked a treat :O)

I can see where i went wrong now...forgot 'fontSize' had a capital S !!!

Many Thanks - you have saved me a big head ache

sskinne avatar Jan 27 '16 13:01 sskinne