Chart.js: [BUG] labelOpts undefined
on line 11546 in dist of 2.7.1:
var fontSize = valueOrDefault(labelOpts.fontSize, globalDefault.defaultFontSize);
labelOpts is undefined.
I just followed the basic getting started:
http://www.chartjs.org/docs/latest/getting-started/usage.html
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (12 by maintainers)
@sweatherall I don’t support you’re using a premade template on your site? Maybe something like Gentelella? I was having the same problem. Stumped me for hours. Turns out the template had an initialization routine that overwrote the label option completely. Do a search in your project for Chart.defaults.global and see if you get any hits.
@scooter12 woooow, im using Gentellela template, and thats the issue, thanks a lot!
I think @Pimnr47 has some code that sets the
legend.labelsoption to somethingundefined. Maybe as the result of some function.Example to trigger issue
To prevent any such cases being reported in the future I think the configuration should be sanitized before being merged with the defaults, or warn the user with
console.warn.